From 0a5f64c17ca4f228fa7f785f9b663e5e8f51f42e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 25 Mar 2026 09:18:51 +0700 Subject: [PATCH] fix: payload profileEmployeeId --- .../GovernmentInformation/08_DialogAbsentLate.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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();