diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue index 3bc7b9c3e..0697b5ad9 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/08_DialogAbsentLate.vue @@ -57,16 +57,23 @@ function onSubmit() { dialogConfirm($q, async () => { try { showLoader(); - const playload = { + const payload = { ...form, stampDate: convertDateToAPI(form.stampDate), - profileId: isStatusEdit.value ? undefined : profileId.value, + profileId: + !isStatusEdit.value && empType.value === "" + ? profileId.value + : undefined, + profileEmployeeId: + !isStatusEdit.value && empType.value !== "" + ? profileId.value + : undefined, }; const method = isStatusEdit.value ? "patch" : "post"; const url = isStatusEdit.value ? config.API.profileAbsentLate(empType.value) + `/${rowId.value}` : config.API.profileAbsentLate(empType.value); - await http[method](url, playload); + await http[method](url, payload); success($q, "บันทึกข้อมูลสำเร็จ"); props.fetchData(); closeDialog();