refactor: add quotation payload

This commit is contained in:
Methapon Metanipat 2024-10-31 13:40:12 +07:00
parent 317aadb0f7
commit e558a19350

View file

@ -73,6 +73,7 @@ export const useQuotationStore = defineStore('quotation-store', () => {
const res = await api.post('/quotation', { const res = await api.post('/quotation', {
...payload, ...payload,
paySplit: data.paySplit.map((v) => ({ paySplit: data.paySplit.map((v) => ({
name: v.name,
amount: v.amount, amount: v.amount,
})), })),
productServiceList: data.productServiceList.map((v) => ({ productServiceList: data.productServiceList.map((v) => ({
@ -108,6 +109,7 @@ export const useQuotationStore = defineStore('quotation-store', () => {
const res = await api.put(`/quotation/${data.id}`, { const res = await api.put(`/quotation/${data.id}`, {
...payload, ...payload,
paySplit: data.paySplit.map((v) => ({ paySplit: data.paySplit.map((v) => ({
name: v.name,
amount: v.amount, amount: v.amount,
})), })),
productServiceList: payload.productServiceList.map((v) => ({ productServiceList: payload.productServiceList.map((v) => ({
@ -119,6 +121,7 @@ export const useQuotationStore = defineStore('quotation-store', () => {
workId: v.work?.id, workId: v.work?.id,
serviceId: v.service?.id, serviceId: v.service?.id,
workerIndex: v.workerIndex, workerIndex: v.workerIndex,
installmentNo: v.installmentNo,
})), })),
id: undefined, id: undefined,
}); });