From c1a9d9302600756901c30411968cfa56d768a15d Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Mon, 7 Oct 2024 17:04:12 +0700 Subject: [PATCH] refactor: handle _count --- src/stores/quotations/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stores/quotations/index.ts b/src/stores/quotations/index.ts index 247f4af0..13dcc601 100644 --- a/src/stores/quotations/index.ts +++ b/src/stores/quotations/index.ts @@ -59,10 +59,12 @@ export const useQuotationStore = defineStore('quotation-store', () => { return null; } - async function createQuotation(payload: QuotationPayload) { + async function createQuotation(data: QuotationPayload) { + const { _count, ...payload } = data; + const res = await api.post('/quotation', { ...payload, - productServiceList: payload.productServiceList.map((v) => ({ + productServiceList: data.productServiceList.map((v) => ({ vat: v.vat, amount: v.amount, pricePerUnit: v.pricePerUnit,