fix: edit sub branch get 404

This commit is contained in:
Methapon Metanipat 2024-09-18 09:51:13 +07:00
parent 62269efbb6
commit 515409955a

View file

@ -455,6 +455,7 @@ async function fetchBranchById(id: string) {
permitIssueDate: new Date(res.permitIssueDate),
permitNo: res.permitNo,
};
return res;
}
}
@ -551,7 +552,7 @@ async function triggerEdit(
typeBranch: 'headOffice' | 'subBranch',
code?: string,
) {
await fetchBranchById(id);
const currentRecord = await fetchBranchById(id);
await fetchImageList(id, formData.value.selectedImage || '');
formTypeBranch.value = typeBranch;
@ -570,7 +571,6 @@ async function triggerEdit(
currentId.value = id;
const currentRecord = branchData.value.result.find((x) => x.id === id);
if (!currentRecord) return;