refactor: handle attachment customer

This commit is contained in:
Thanaphon Frappet 2024-11-12 15:59:28 +07:00
parent 5be282b8d0
commit ae83a574e0

View file

@ -13,11 +13,12 @@ import {
CitizenPayload,
} from './types';
import { Employee } from '../employee/types';
import { baseUrl, manageFile, manageMeta } from '../utils';
import { baseUrl, manageAttachment, manageFile, manageMeta } from '../utils';
const useCustomerStore = defineStore('api-customer', () => {
const data = ref<Pagination<Customer[]>>();
const attachmentManager = manageAttachment(api, 'customer-branch');
const fileManager = manageFile<
| 'citizen'
| 'house-registration'
@ -490,11 +491,8 @@ const useCustomerStore = defineStore('api-customer', () => {
fetchBranchEmployee,
listAttachment,
getAttachment,
putAttachment,
deleteAttachment,
...attachmentManager,
...fileManager,
...metaManager,
};