fix: error types

This commit is contained in:
Methapon Metanipat 2024-10-07 13:53:43 +07:00
parent b0800c7b05
commit 4e21ded2db
2 changed files with 8 additions and 0 deletions

View file

@ -69,6 +69,13 @@ export const useQuotationForm = defineStore('form-quotation', () => {
if (!data) return; // NOTE: Error should be handled globally by axios instance
resetFormData = Object.assign(data, {
productServiceList: data.productServiceList.map((v) => ({
...v,
worker: undefined,
workerIndex: v.worker.map((a) =>
data.worker.findIndex((b) => b.employeeId === a.id),
),
})),
dueDate: new Date(data.dueDate),
payBillDate: data.payBillDate ? new Date(data.payBillDate) : undefined,
worker: data.worker.map((v) =>

View file

@ -208,6 +208,7 @@ export type QuotationFull = {
work: WorkRelation | null;
serviceId: string | null;
service: ServiceRelation | null;
worker: EmployeeRelation[];
}[];
id: string;