fix bug KPI ไม่ fetch ข้อมูล การพัฒนาตนเองเมื่อเพิ่ม

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-08-21 09:28:54 +07:00
parent af74caf64e
commit ca8fa3b420

View file

@ -198,7 +198,8 @@ function onSubmit() {
) { ) {
dialogMessageNotify($q, "กรุณาเลือกวิธีการพัฒนา อย่างน้อย 1 ตัวเลือก"); dialogMessageNotify($q, "กรุณาเลือกวิธีการพัฒนา อย่างน้อย 1 ตัวเลือก");
} else { } else {
dialogConfirm($q, () => { dialogConfirm($q, async () => {
showLoader();
const url = id.value const url = id.value
? config.API.kpiAchievementDevelop + `/${id.value}` ? config.API.kpiAchievementDevelop + `/${id.value}`
: config.API.kpiAchievementDevelop; : config.API.kpiAchievementDevelop;
@ -220,11 +221,11 @@ function onSubmit() {
selectTypeYear: formData.year ? formData.year.toString() : null, selectTypeYear: formData.year ? formData.year.toString() : null,
selectTypeId: projectName.value ? projectName.value.id : null, selectTypeId: projectName.value ? projectName.value.id : null,
}; };
isLoadMain.value = true; await http[id.value ? "put" : "post"](url, body)
http[id.value ? "put" : "post"](url, body) .then(async () => {
.then((res) => { await props?.getAll?.();
close();
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
close();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);