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