jws-frontend/src/stores/branch/index.ts

459 lines
11 KiB
TypeScript
Raw Normal View History

import { ref, watch } from 'vue';
2024-04-03 10:38:35 +07:00
import { defineStore } from 'pinia';
2024-08-22 14:30:47 +07:00
2024-04-03 10:38:35 +07:00
import { api } from 'src/boot/axios';
2024-08-22 14:30:47 +07:00
import useFlowStore from '../flow';
import { Pagination } from '../types';
2024-08-02 11:13:21 +00:00
import { BankBook, Branch, BranchCreate } from './types';
import { BranchContact } from '../branch-contact/types';
2024-08-14 15:30:01 +07:00
import { User } from '../user/types';
type BranchId = string;
2024-04-03 10:38:35 +07:00
const useBranchStore = defineStore('api-branch', () => {
2024-06-25 16:05:42 +07:00
const flowStore = useFlowStore();
2024-09-11 15:41:35 +07:00
const data = ref<Pagination<(Branch & { branch?: Branch[] })[]>>({
result: [],
page: 0,
pageSize: 0,
total: 0,
});
const map = ref<Record<BranchId, Branch & { contact?: BranchContact[] }>>({});
2024-04-12 22:08:01 +07:00
const contact: Record<BranchId, BranchContact[]> = {};
watch(data, () => {
data.value.result.forEach((v) => {
map.value[v.id] = v;
});
});
2024-04-03 10:38:35 +07:00
async function fetchList<
Options extends {
2024-04-03 17:47:58 +07:00
page?: number;
pageSize?: number;
zipCode?: string;
query?: string;
tree?: boolean;
filter?: 'head' | 'sub';
2024-04-03 17:47:58 +07:00
},
Data extends Pagination<Branch[]>,
2024-08-22 14:30:47 +07:00
>(opts?: Options): Promise<Data | false> {
2024-04-03 10:38:35 +07:00
const params = new URLSearchParams();
2024-08-19 11:49:32 +07:00
for (const [k, v] of Object.entries(opts || {})) {
2024-08-22 14:30:47 +07:00
if (v !== undefined) params.append(k, v.toString());
2024-04-03 10:38:35 +07:00
}
const query = params.toString();
const res = await api.get<Data>(
2024-04-03 10:38:35 +07:00
`/branch${(params && '?'.concat(query)) || ''}`,
2024-08-22 14:30:47 +07:00
{ headers: { 'X-Rtid': flowStore.rtid } },
2024-04-03 10:38:35 +07:00
);
if (res && res.status === 200) {
data.value = res.data;
return res.data;
2024-04-03 10:38:35 +07:00
}
return false;
}
async function fetchById<
2024-04-12 22:08:01 +07:00
Options extends { includeSubBranch?: boolean; includeContact?: boolean },
Data extends Branch &
2024-04-12 22:08:01 +07:00
(Options['includeSubBranch'] extends true
? { branch: Branch[] }
: unknown) &
(Options['includeContact'] extends true
? { contact: BranchContact[] }
: unknown),
2024-08-22 14:30:47 +07:00
>(id: string, opts?: Options): Promise<Data | false> {
const params = new URLSearchParams();
2024-04-12 22:08:01 +07:00
for (const [k, v] of Object.entries(opts || {})) {
2024-08-22 14:30:47 +07:00
if (v !== undefined) params.append(k, v.toString());
2024-04-12 22:08:01 +07:00
}
const query = params.toString();
const res = await api.get<Data>(
`/branch/${id}${(params && '?'.concat(query)) || ''}`,
2024-08-22 14:30:47 +07:00
{ headers: { 'X-Rtid': flowStore.rtid } },
);
2024-04-03 10:38:35 +07:00
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
Squashed commit of the following: commit eb6c7b164a9f182f8d1ce73cc5354866c6d6b10e Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:29:44 2024 +0700 refactor: no img close to default on create commit eae9eb26071cc2985624bb1c6ce551bf5eb6eb8b Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:04:04 2024 +0700 refactor/feat: save => apply, disabled selected img, no img close to default commit ccbf80fc53db3144873c049bd6dbd37b4e2e9ff3 Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 09:31:32 2024 +0700 fix(01): use submit function commit 36b4f6ca15e5966f37dfefc9fdb744feec60dd27 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:45:19 2024 +0700 fix: imgList error commit bac0eaf3ab955672ae0c78d3295b4a839827c5f2 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:18:03 2024 +0700 refactor(03): customer new upload img dialog commit 9d7398e9613a738c33e265482cdb7d7bb250ea9f Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:40:39 2024 +0700 refactor(02): new upload dialog commit 8b91d43f41eae3ba2442f6c742d617c25ee180cb Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:25:21 2024 +0700 refactor(01): new upload dialog, confirm remove, individual action commit 61caf1919168bc5635568d7ca246574fdc43cd04 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(01): branch new img upload commit e791b7316d001d839c8afb1950f7331c62d9e81a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(02): personnel new img upload commit af4d11312b9cb666338901efa9971117cb7738c4 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 feat(02): new image upload commit e4d7afdb8c74d65a550644f2c60f70909d51d4a8 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock select image function commit 5ab3f045b9c7d2c821920c12114da15eed09655a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock new image preview
2024-09-11 16:43:41 +07:00
async function fetchImageListById(
id: string,
flow?: {
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.get(`/branch/${id}/image`, {
headers: {
'X-Session-Id': flow?.sessionId,
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
'X-Tid': flow?.transactionId,
},
});
if (!res) return false;
if (res.status === 200) return res.data;
if (res.status === 204) return null;
return false;
}
async function addImageList(file: File, branchId: string, name: string) {
await api
.put(`/branch/${branchId}/image/${name}`, file, {
headers: { 'Content-Type': file.type },
onUploadProgress: (e) => console.log(e),
})
.catch((e) => console.error(e));
return name;
}
async function deleteImageByName(
id: string,
name: string,
flow?: {
sessionId?: string;
refTransactionId?: string;
transactionId?: string;
},
) {
const res = await api.delete(`/branch/${id}/image/${name}`, {
headers: {
'X-Session-Id': flow?.sessionId,
'X-Rtid': flow?.refTransactionId || flowStore.rtid,
'X-Tid': flow?.transactionId,
},
});
if (!res) return false;
}
async function create(
branch: BranchCreate,
bank?: BankBook[],
imgList?: {
selectedImage: string;
list: { url: string; imgFile: File | null; name: string }[];
},
) {
const { qrCodeImage, zipCode, ...payload } = branch;
2024-09-11 13:56:33 +07:00
const bankPayload = bank?.map(({ bankUrl, bankQr, ...rest }) => ({
2024-09-05 15:25:35 +07:00
...rest,
}));
const res = await api.post<Branch>(
2024-08-02 11:13:21 +00:00
'/branch',
Squashed commit of the following: commit eb6c7b164a9f182f8d1ce73cc5354866c6d6b10e Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:29:44 2024 +0700 refactor: no img close to default on create commit eae9eb26071cc2985624bb1c6ce551bf5eb6eb8b Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:04:04 2024 +0700 refactor/feat: save => apply, disabled selected img, no img close to default commit ccbf80fc53db3144873c049bd6dbd37b4e2e9ff3 Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 09:31:32 2024 +0700 fix(01): use submit function commit 36b4f6ca15e5966f37dfefc9fdb744feec60dd27 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:45:19 2024 +0700 fix: imgList error commit bac0eaf3ab955672ae0c78d3295b4a839827c5f2 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:18:03 2024 +0700 refactor(03): customer new upload img dialog commit 9d7398e9613a738c33e265482cdb7d7bb250ea9f Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:40:39 2024 +0700 refactor(02): new upload dialog commit 8b91d43f41eae3ba2442f6c742d617c25ee180cb Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:25:21 2024 +0700 refactor(01): new upload dialog, confirm remove, individual action commit 61caf1919168bc5635568d7ca246574fdc43cd04 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(01): branch new img upload commit e791b7316d001d839c8afb1950f7331c62d9e81a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(02): personnel new img upload commit af4d11312b9cb666338901efa9971117cb7738c4 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 feat(02): new image upload commit e4d7afdb8c74d65a550644f2c60f70909d51d4a8 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock select image function commit 5ab3f045b9c7d2c821920c12114da15eed09655a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock new image preview
2024-09-11 16:43:41 +07:00
{
...payload,
selectedImage: (imgList && imgList.selectedImage) || '',
bank: bankPayload,
},
2024-08-22 14:30:47 +07:00
{ headers: { 'X-Rtid': flowStore.rtid } },
2024-08-02 11:13:21 +00:00
);
2024-04-03 10:38:35 +07:00
2024-08-22 14:30:47 +07:00
if (qrCodeImage) {
await api
.put(`/branch/${res.data.id}/line-image`, qrCodeImage, {
headers: { 'Content-Type': qrCodeImage.type },
onUploadProgress: (e) => console.log(e),
})
2024-08-22 14:30:47 +07:00
.catch((e) => console.error(e));
}
2024-09-10 17:32:12 +07:00
if (res.data.bank && bank) {
2024-09-05 15:25:35 +07:00
for (let i = 0; i < bank?.length; i++) {
if (bank[i].bankQr) {
await api
.put(
`/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`,
bank[i].bankQr,
{
2024-09-10 17:32:12 +07:00
headers: { 'Content-Type': bank[i].bankQr?.type },
2024-09-05 15:25:35 +07:00
onUploadProgress: (e) => console.log(e),
},
)
.catch((e) => console.error(e));
}
}
}
Squashed commit of the following: commit eb6c7b164a9f182f8d1ce73cc5354866c6d6b10e Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:29:44 2024 +0700 refactor: no img close to default on create commit eae9eb26071cc2985624bb1c6ce551bf5eb6eb8b Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:04:04 2024 +0700 refactor/feat: save => apply, disabled selected img, no img close to default commit ccbf80fc53db3144873c049bd6dbd37b4e2e9ff3 Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 09:31:32 2024 +0700 fix(01): use submit function commit 36b4f6ca15e5966f37dfefc9fdb744feec60dd27 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:45:19 2024 +0700 fix: imgList error commit bac0eaf3ab955672ae0c78d3295b4a839827c5f2 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:18:03 2024 +0700 refactor(03): customer new upload img dialog commit 9d7398e9613a738c33e265482cdb7d7bb250ea9f Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:40:39 2024 +0700 refactor(02): new upload dialog commit 8b91d43f41eae3ba2442f6c742d617c25ee180cb Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:25:21 2024 +0700 refactor(01): new upload dialog, confirm remove, individual action commit 61caf1919168bc5635568d7ca246574fdc43cd04 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(01): branch new img upload commit e791b7316d001d839c8afb1950f7331c62d9e81a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(02): personnel new img upload commit af4d11312b9cb666338901efa9971117cb7738c4 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 feat(02): new image upload commit e4d7afdb8c74d65a550644f2c60f70909d51d4a8 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock select image function commit 5ab3f045b9c7d2c821920c12114da15eed09655a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock new image preview
2024-09-11 16:43:41 +07:00
if (imgList && imgList.list.length > 0 && res.data.id) {
for (let index = 0; index < imgList.list.length; index++) {
const imgFile = imgList.list[index].imgFile;
if (imgFile)
await addImageList(imgFile, res.data.id, imgList.list[index].name);
}
}
2024-04-03 10:38:35 +07:00
if (!res) return false;
return res.data;
}
2024-04-04 11:46:25 +07:00
async function editById(
2024-04-03 10:38:35 +07:00
id: string,
2024-04-18 18:07:38 +07:00
data: Partial<BranchCreate & { status: 'ACTIVE' | 'INACTIVE' | 'CREATED' }>,
qrCodeImage?: File | undefined,
2024-08-02 11:13:21 +00:00
bank?: BankBook[],
2024-09-11 13:44:34 +07:00
opts?: {
deleteQrCodeImage?: boolean;
indexDeleteQrCodeBank?: number[];
},
2024-04-03 10:38:35 +07:00
) {
2024-09-12 10:26:15 +07:00
const { zipCode, ...payload } = data;
2024-09-11 13:44:34 +07:00
const bankPayload = bank?.map(({ branchId, bankQr, bankUrl, ...rest }) => ({
2024-09-05 15:25:35 +07:00
...rest,
}));
const res = await api.put<Branch>(
2024-08-02 11:13:21 +00:00
`/branch/${id}`,
2024-09-05 15:25:35 +07:00
{ ...payload, bank: bankPayload },
2024-08-02 11:13:21 +00:00
{
2024-08-22 14:30:47 +07:00
headers: { 'X-Rtid': flowStore.rtid },
2024-04-03 17:47:58 +07:00
},
2024-08-02 11:13:21 +00:00
);
2024-09-11 13:44:34 +07:00
if (qrCodeImage !== undefined && qrCodeImage !== null) {
2024-08-22 14:30:47 +07:00
await api
.put(`/branch/${res.data.id}/line-image`, qrCodeImage, {
headers: { 'Content-Type': qrCodeImage.type },
onUploadProgress: (e) => console.log(e),
})
.catch((e) => console.error(e));
}
2024-09-11 13:44:34 +07:00
if (opts?.deleteQrCodeImage === true) {
await api
.delete(`/branch/${res.data.id}/line-image`)
.catch((e) => console.error(e));
}
2024-04-03 10:38:35 +07:00
2024-09-11 13:44:34 +07:00
if (!!res.data.bank && !!bank) {
2024-09-05 15:25:35 +07:00
for (let i = 0; i < bank?.length; i++) {
2024-09-11 13:44:34 +07:00
if (bank?.[i].bankQr) {
2024-09-05 15:25:35 +07:00
await api
.put(
`/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`,
bank[i].bankQr,
{
2024-09-10 17:32:12 +07:00
headers: { 'Content-Type': bank[i].bankQr?.type },
2024-09-05 15:25:35 +07:00
onUploadProgress: (e) => console.log(e),
},
)
.catch((e) => console.error(e));
}
}
2024-09-11 13:44:34 +07:00
if (
opts?.indexDeleteQrCodeBank !== undefined &&
opts?.indexDeleteQrCodeBank?.length >= 0
) {
opts.indexDeleteQrCodeBank.forEach(async (i) => {
await api
.delete(`/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`)
.catch((e) => console.error(e));
});
}
2024-09-05 15:25:35 +07:00
}
2024-04-03 10:38:35 +07:00
if (!res) return false;
return res.data;
}
2024-08-22 14:30:47 +07:00
async function deleteById(id: string) {
2024-04-03 17:47:58 +07:00
const res = await api.delete<Branch>(`/branch/${id}`, {
headers: {
2024-08-22 14:30:47 +07:00
'X-Rtid': flowStore.rtid,
2024-04-03 17:47:58 +07:00
},
});
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
2024-08-22 14:30:47 +07:00
async function getUser(branchId: string) {
2024-04-03 17:47:58 +07:00
const res = await api.get(`/branch/${branchId}/user`, {
2024-08-22 14:30:47 +07:00
headers: { 'X-Rtid': flowStore.rtid },
2024-04-03 17:47:58 +07:00
});
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
2024-08-22 14:30:47 +07:00
async function getAdmin(branchId: string | string[]) {
2024-08-30 09:47:04 +07:00
const res = await api.get<User>(`/branch/${branchId}/manager`, {
2024-08-22 14:30:47 +07:00
headers: { 'X-Rtid': flowStore.rtid },
2024-08-14 15:30:01 +07:00
});
if (!res) return false;
if (res.status === 200) return res.data;
if (res.status === 204) return null;
return false;
}
2024-08-22 14:30:47 +07:00
async function addUser(branchId: string, userId: string | string[]) {
2024-04-03 17:47:58 +07:00
const res = await api.post(
`/branch/${branchId}/user`,
{ user: ([] as string[]).concat(userId) },
2024-08-22 14:30:47 +07:00
{ headers: { 'X-Rtid': flowStore.rtid } },
2024-04-03 17:47:58 +07:00
);
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
2024-08-22 14:30:47 +07:00
async function removeUser(branchId: string, userId: string | string[]) {
2024-04-03 17:47:58 +07:00
const res = await api.delete(`/branch/${branchId}/user`, {
2024-08-22 14:30:47 +07:00
headers: { 'X-Rtid': flowStore.rtid },
2024-04-03 17:47:58 +07:00
data: { user: ([] as string[]).concat(userId) },
});
2024-04-03 10:38:35 +07:00
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
2024-09-06 17:25:22 +07:00
async function stats(opts?: { headOfficeId?: string }) {
const params = new URLSearchParams();
for (const [k, v] of Object.entries(opts || {})) {
v !== undefined && params.append(k, v.toString());
}
const query = params.toString();
2024-04-10 17:41:41 +07:00
const res = await api.get<{
hq: number;
br: number;
2024-09-06 11:35:49 +07:00
virtual: number;
2024-09-06 17:25:22 +07:00
}>(`/branch/stats${(params && '?'.concat(query)) || ''}`, {
2024-04-10 17:41:41 +07:00
headers: {
2024-08-22 14:30:47 +07:00
'X-Rtid': flowStore.rtid,
2024-04-10 17:41:41 +07:00
},
});
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
2024-08-22 14:30:47 +07:00
async function userStats(userType: string) {
2024-04-10 17:41:41 +07:00
const res = await api.get(
`/branch/user-stats${userType ? '?'.concat(userType) : ''}`,
{
2024-08-22 14:30:47 +07:00
headers: { 'X-Rtid': flowStore.rtid },
2024-04-10 13:59:13 +07:00
},
2024-04-10 17:41:41 +07:00
);
2024-04-10 13:59:13 +07:00
if (!res) return false;
if (res.status === 200) return res.data;
return false;
}
2024-08-22 14:30:47 +07:00
async function getContact(branchId: BranchId, force = false) {
2024-04-12 22:08:01 +07:00
if (!force && contact[branchId]) return contact[branchId];
2024-08-22 14:30:47 +07:00
const res = await fetchById(branchId, { includeContact: true });
2024-04-12 22:08:01 +07:00
if (res) {
contact[branchId] = res.contact;
return res.contact;
}
return false;
}
2024-09-16 10:26:16 +07:00
async function fetchListAttachment(branchId: string) {
const res = await api.get<string[]>(`branch/${branchId}/attachment`);
if (res.status === 200) {
return res.data;
}
}
async function fetchByIdAttachment(branchId: string, name: string) {
const res = await api.get<string>(`branch/${branchId}/attachment/${name}`);
if (res.status === 200) {
return res.data;
}
}
async function putAttachment(branchId: string, fileList: File[]) {
fileList.forEach(async (file) => {
await api
.put(`branch/${branchId}/attachment/${file.name}`, file, {
headers: { 'Content-Type': file.type },
onUploadProgress: (e) => console.log(e),
})
.catch((e) => console.error(e));
});
}
async function deleteByIdAttachment(branchId: string, name: string) {
const res = await api.delete(`branch/${branchId}/attachment/${name}`);
if (res.status === 204) {
2024-09-16 10:28:49 +07:00
return true;
2024-09-16 10:26:16 +07:00
}
2024-09-16 10:28:49 +07:00
return false;
2024-09-16 10:26:16 +07:00
}
2024-04-03 10:38:35 +07:00
return {
data,
map,
2024-04-04 11:46:25 +07:00
fetchList,
fetchById,
2024-04-03 10:38:35 +07:00
Squashed commit of the following: commit eb6c7b164a9f182f8d1ce73cc5354866c6d6b10e Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:29:44 2024 +0700 refactor: no img close to default on create commit eae9eb26071cc2985624bb1c6ce551bf5eb6eb8b Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 11:04:04 2024 +0700 refactor/feat: save => apply, disabled selected img, no img close to default commit ccbf80fc53db3144873c049bd6dbd37b4e2e9ff3 Author: puriphatt <puriphat@frappet.com> Date: Wed Sep 11 09:31:32 2024 +0700 fix(01): use submit function commit 36b4f6ca15e5966f37dfefc9fdb744feec60dd27 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:45:19 2024 +0700 fix: imgList error commit bac0eaf3ab955672ae0c78d3295b4a839827c5f2 Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 17:18:03 2024 +0700 refactor(03): customer new upload img dialog commit 9d7398e9613a738c33e265482cdb7d7bb250ea9f Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:40:39 2024 +0700 refactor(02): new upload dialog commit 8b91d43f41eae3ba2442f6c742d617c25ee180cb Author: puriphatt <puriphat@frappet.com> Date: Tue Sep 10 15:25:21 2024 +0700 refactor(01): new upload dialog, confirm remove, individual action commit 61caf1919168bc5635568d7ca246574fdc43cd04 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(01): branch new img upload commit e791b7316d001d839c8afb1950f7331c62d9e81a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 refactor(02): personnel new img upload commit af4d11312b9cb666338901efa9971117cb7738c4 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:42 2024 +0700 feat(02): new image upload commit e4d7afdb8c74d65a550644f2c60f70909d51d4a8 Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock select image function commit 5ab3f045b9c7d2c821920c12114da15eed09655a Author: puriphatt <puriphat@frappet.com> Date: Mon Sep 9 17:08:41 2024 +0700 refactor: mock new image preview
2024-09-11 16:43:41 +07:00
fetchImageListById,
addImageList,
deleteImageByName,
2024-04-04 11:46:25 +07:00
create,
editById,
deleteById,
2024-04-03 17:47:58 +07:00
2024-08-14 15:30:01 +07:00
getAdmin,
2024-04-03 17:47:58 +07:00
getUser,
addUser,
removeUser,
2024-04-10 13:59:13 +07:00
2024-04-12 22:08:01 +07:00
getContact,
2024-04-10 17:41:41 +07:00
stats,
2024-04-10 13:59:13 +07:00
userStats,
2024-09-16 10:26:16 +07:00
fetchListAttachment,
fetchByIdAttachment,
putAttachment,
deleteByIdAttachment,
2024-04-03 10:38:35 +07:00
};
});
export default useBranchStore;