diff --git a/src/modules/13_salary/views/salaryEmployeeRate.vue b/src/modules/13_salary/views/salaryEmployeeRate.vue index d99241b1a..275e19fbb 100644 --- a/src/modules/13_salary/views/salaryEmployeeRate.vue +++ b/src/modules/13_salary/views/salaryEmployeeRate.vue @@ -168,17 +168,19 @@ function onEdit(data: EmployeeRateSalary) { */ function onDelete(id: string) { dialogRemove($q, () => { + showLoader(); http .delete(config.API.salaryEmployeeRateListByid(id)) - .then(() => { - fetchSalalyEmployeeRate(); - success($q, "ลบข้อมูลสำเร็จ"); + .then(async () => { + await fetchSalalyEmployeeRate(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); - hideLoader(); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); }); } @@ -225,8 +227,7 @@ watch( ); onMounted(async () => { - await fetchDataDetail(); - await fetchSalalyEmployeeRate(); + await Promise.all([fetchDataDetail(), fetchSalalyEmployeeRate()]); });