refactor:subitm return status
This commit is contained in:
parent
a066b2c843
commit
d15bb7ef6f
1 changed files with 8 additions and 2 deletions
|
|
@ -130,7 +130,6 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
||||||
|
|
||||||
currentFormData.value = structuredClone(resetFormData);
|
currentFormData.value = structuredClone(resetFormData);
|
||||||
|
|
||||||
console.log('ทำงาน');
|
|
||||||
currentFormState.value.mode = mode;
|
currentFormState.value.mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,13 +147,20 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
||||||
file: v.file,
|
file: v.file,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentFormState.value.mode === 'edit' && currentFormData.value.id) {
|
if (currentFormState.value.mode === 'edit' && currentFormData.value.id) {
|
||||||
await quotationStore.editQuotation({
|
if (currentFormData.value.status === 'CREATED') {
|
||||||
|
delete currentFormData.value?.['status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await quotationStore.editQuotation({
|
||||||
...currentFormData.value,
|
...currentFormData.value,
|
||||||
id: currentFormData.value.id,
|
id: currentFormData.value.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (res) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentFormState.value.mode = 'info';
|
currentFormState.value.mode = 'info';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue