From cd7bbc21a6151d5bd31401cc7a6e4dbca7ef34af Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 28 Aug 2024 13:47:23 +0700 Subject: [PATCH] refactor: deleteAttachment return data --- src/stores/customer/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts index 3abdf649..70944cd2 100644 --- a/src/stores/customer/index.ts +++ b/src/stores/customer/index.ts @@ -230,7 +230,12 @@ const useCustomerStore = defineStore('api-customer', () => { } async function deleteAttachment(id: string, filename: string) { - await api.delete(`/customer-branch/${id}/attachment/{${filename}}`); + const res = await api.delete( + `/customer-branch/${id}/attachment/{${filename}}`, + ); + + if (res.status >= 400) return false; + return true; } async function listAttachment(id: string) {