From ef82393db1ec312eacb9cb4c5939d0f9b622dd83 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 10 Oct 2024 13:34:27 +0700 Subject: [PATCH] refactor: at edit handle _count --- src/stores/quotations/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stores/quotations/index.ts b/src/stores/quotations/index.ts index 43be6352..541649e0 100644 --- a/src/stores/quotations/index.ts +++ b/src/stores/quotations/index.ts @@ -81,8 +81,9 @@ export const useQuotationStore = defineStore('quotation-store', () => { return null; } - async function editQuotation(payload: QuotationPayload & { id: string }) { - const res = await api.put(`/quotation/${payload.id}`, { + async function editQuotation(data: QuotationPayload & { id: string }) { + const { _count, ...payload } = data; + const res = await api.put(`/quotation/${data.id}`, { ...payload, productServiceList: payload.productServiceList.map((v) => ({ vat: v.vat,