diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts index af89ec07..d920b924 100644 --- a/src/stores/customer/index.ts +++ b/src/stores/customer/index.ts @@ -20,6 +20,13 @@ const useCustomerStore = defineStore('api-customer', () => { const flowStore = useFlowStore(); const data = ref>(); + async function setImage(id: string, image: File) { + await api.put(`/customer/${id}/image`, image, { + headers: { 'Content-Type': image?.type }, + onUploadProgress: (e) => console.log(e), + }); + } + async function fetchById( customerId: string, flow?: { @@ -480,6 +487,7 @@ const useCustomerStore = defineStore('api-customer', () => { getStatsCustomer, + setImage, fetchListCustomeBranch, fetchById, fetchList,