From ae83a574e05a65c823916c029282f33203c3837c Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Tue, 12 Nov 2024 15:59:28 +0700 Subject: [PATCH] refactor: handle attachment customer --- src/stores/customer/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts index 61da20fb..2ef12578 100644 --- a/src/stores/customer/index.ts +++ b/src/stores/customer/index.ts @@ -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>(); + 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, };