This commit is contained in:
Warunee Tamkoo 2024-02-12 11:28:26 +07:00
parent 853a78f139
commit 1915538e5e

View file

@ -186,9 +186,9 @@ const calRetire = async (birth: Date) => {
dateBefore.value = birth;
})
.catch((e: any) => {
messageError($q, e);
informaData.value.birthDate = null;
informaData.value.age = "";
messageError($q, e);
informaData.value.birthDate = null;
informaData.value.age = "";
})
.finally(() => {
// hideLoader();
@ -244,24 +244,20 @@ const addData = async () => {
if (informaData.value.employeeClass != undefined)
formData.append("employeeClass", informaData.value.employeeClass);
console.log("informaData===>", informaData.value);
// showLoader();
// await http
// .post(config.API.createProfileOfficer(), formData)
// .then((res) => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// modal.value = false;
// await changeBirth(
// new Date(dateToPost(new Date(informaData.value.birthDate))) ??
// new Date()
// );
// hideLoader();
// });
showLoader();
await http
.post(config.API.createProfileOfficer(), formData)
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
modal.value = false;
await changeBirth(new Date(informaData.value.birthDate) ?? new Date());
hideLoader();
});
};
/*** get รายการข้อมูลเกี่ยวกับบุคคล (dropdown list) */