diff --git a/src/modules/02_organization/components/DialogFormAgency.vue b/src/modules/02_organization/components/DialogFormAgency.vue index 31963fbd6..53f3f93f5 100644 --- a/src/modules/02_organization/components/DialogFormAgency.vue +++ b/src/modules/02_organization/components/DialogFormAgency.vue @@ -121,28 +121,25 @@ function onSubmit() { ["org" + type + "Fax"]: formData.orgFax, ["org" + type + "Rank"]: formData.orgLevel, ["org" + type + "RankSub"]: formData.orgLevelSub, - misId: formData.misId, + misId: formData.misId ? formData.misId : "", + isDeputy: + type === "Root" + ? formData.isDeputy + ? formData.isDeputy + : false + : undefined, + isOfficer: + type === "Child1" + ? formData.isOfficer + ? formData.isOfficer + : false + : undefined, [nameId]: rootId, responsibility: formData.responsibility != null ? formData.responsibility : "", }; - if (type === "Root") { - body = { - ...body, - isDeputy: - formData.isDeputy !== undefined ? String(formData.isDeputy) : "", - }; - } - if (type === "Child1") { - body = { - ...body, - isOfficer: - formData.isOfficer !== undefined ? String(formData.isOfficer) : "", - }; - } - //เพิ่มข้อมูล if (actionType.value === "ADD") { await http @@ -208,6 +205,7 @@ function closeClear() { formData.orgLevel = ""; formData.responsibility = ""; formData.isOfficer = false; + formData.isDeputy = false; formData.misId = ""; props.close?.(); }