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