refactor: add deleteAttachment

This commit is contained in:
Net 2024-08-28 17:36:19 +07:00 committed by Methapon Metanipat
parent f922a3a7e5
commit 659f2f5da5

View file

@ -72,6 +72,16 @@ export const useCustomerForm = defineStore('form-customer', () => {
(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() {
return (
JSON.stringify(resetFormData) !== JSON.stringify(currentFormData.value)