diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index bf8df30a..a24b296c 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -169,17 +169,12 @@ function changeSubject( typeBranch: 'headOffice' | 'subBranch', ) { if (typeBranch === 'headOffice') { - if (formType === 'create') { - return 'เพิ่มสำนักงานใหญ่'; - } - return 'แก้ไขสำนักงานใหญ่'; + return formType === 'create' ? 'เพิ่มสำนักงานใหญ่' : 'แก้ไขสำนักงานใหญ่'; } if (typeBranch === 'subBranch') { - if (formType === 'create') { - return 'เพิ่มสาขา'; - } - return 'แก้ไขสาขา'; + return formType === 'create' ? 'เพิ่มสาขา' : 'แก้ไขสาขา'; } + return ''; } function triggerCreateSubBranch(code: string, id: string) { @@ -324,7 +319,7 @@ async function submitForm( await branchContactStore.create( result.id, inputBranchContactCreate, - profileFile.value as File, + profileFile.value, ); getTree(); modal.value = false; @@ -353,7 +348,7 @@ async function submitForm( await branchContactStore.create( result.id, inputBranchContactCreate, - profileFile.value as File, + profileFile.value, ); getTree(); modal.value = false; @@ -737,15 +732,13 @@ onMounted(async () => {