refactor: add deleteAttachment
This commit is contained in:
parent
f922a3a7e5
commit
659f2f5da5
1 changed files with 10 additions and 0 deletions
|
|
@ -72,6 +72,16 @@ export const useCustomerForm = defineStore('form-customer', () => {
|
||||||
(v) => (defaultFormData.customerType = v.customerType),
|
(v) => (defaultFormData.customerType = v.customerType),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
async function deleteAttachment(
|
||||||
|
id: { branchId: string; customerId: string },
|
||||||
|
filename: string,
|
||||||
|
) {
|
||||||
|
const res = await customerStore.deleteAttachment(id.branchId, filename);
|
||||||
|
if (res) {
|
||||||
|
assignFormData(id.customerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function isFormDataDifferent() {
|
function isFormDataDifferent() {
|
||||||
return (
|
return (
|
||||||
JSON.stringify(resetFormData) !== JSON.stringify(currentFormData.value)
|
JSON.stringify(resetFormData) !== JSON.stringify(currentFormData.value)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue