feat(registry): integrate delete API

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-18 16:15:55 +07:00
parent 04a76b3025
commit 64489162ae
17 changed files with 252 additions and 180 deletions

View file

@ -30,6 +30,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const { createPathUploadFlie, getPathUploadFlie, uploadFile } =
useRegistryNewDataStore();
@ -361,18 +362,20 @@ function serchDataTable() {
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData(id.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileCertificateUpdateDelete(empType.value) + `${rowId}`
);
await fetchData(id.value);
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/**

View file

@ -405,7 +405,7 @@ function onDelete(rowId: string) {
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(config.API.profileTrainingUpdate + `${rowId}`);
await http.patch(config.API.profileTrainingUpdate(empType.value) + `${rowId}`);
await fetchData(id.value);
await success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {

View file

@ -37,6 +37,7 @@ const {
dialogConfirm,
pathRegistryEmp,
onSearchDataTable,
dialogRemove,
} = mixin;
const isUpload = ref<boolean>(false);
@ -333,8 +334,6 @@ async function getInsigniaActive() {
.get(config.API.orgInsigniaActive())
.then((res) => {
const data = res.data.result;
console.log(data);
mapInsigniaOption(data);
})
.catch((e) => {
@ -647,18 +646,20 @@ function serchDataTable() {
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewInsignUpdateDelete(empType.value) + `${rowId}`
);
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/

View file

@ -33,6 +33,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const profileId = ref<string>(
@ -446,18 +447,20 @@ function serchDataTable() {
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewHonorUpdateDelete(empType.value) + `${rowId}`
);
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/

View file

@ -526,7 +526,9 @@ function onDelete(rowId: string) {
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(config.API.profileDevelopmentUpdateDelete + `${rowId}`);
await http.patch(
config.API.profileDevelopmentUpdateDelete(empType.value) + `${rowId}`
);
empType.value !== "-temp" && (await getDevelop());
await success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
@ -542,18 +544,20 @@ function onDelete(rowId: string) {
* @param rowId องการลบขอม
*/
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewAssessmentsUpdateDelete(empType.value) + `${rowId}`
);
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
onMounted(async () => {

View file

@ -35,6 +35,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const profileId = ref<string>(
@ -461,18 +462,20 @@ function serchDataTable() {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData(profileId.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewDisciplineUpdateDelete(empType.value) + `${id}`
);
await fetchData(profileId.value);
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/

View file

@ -39,6 +39,7 @@ const {
dateToISO,
pathRegistryEmp,
onSearchDataTable,
dialogRemove,
} = mixin;
const profileId = ref<string>(
@ -477,18 +478,20 @@ function clickEditRowType() {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await getData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewLeaveUpdateDelete(empType.value) + `${id}`
);
await getData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/

View file

@ -31,6 +31,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const profileId = ref<string>(
@ -448,19 +449,21 @@ function serchDataTable() {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData(profileId.value);
//
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileDutyUpdateDelete(empType.value) + `${id}`
);
await fetchData(profileId.value);
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งา*/

View file

@ -299,7 +299,9 @@ function onDelete(rowId: string) {
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(config.API.profileActpositionUpdateDelete + `${rowId}`);
await http.patch(
config.API.profileActpositionUpdateDelete(empType.value) + `${rowId}`
);
await fetchData();
await success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {

View file

@ -35,6 +35,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const profileId = ref<string>(
@ -439,18 +440,20 @@ async function onReturner(refId: string) {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileAssistanceUpdateDelete(empType.value) + `${id}`
);
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
onMounted(() => {

View file

@ -26,6 +26,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const id = ref<string>("");
@ -243,18 +244,20 @@ function serchDataTable() {
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await getData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileOtherUpdateDelete(empType.value) + `${rowId}`
);
await getData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
onMounted(() => {

View file

@ -368,18 +368,20 @@ function searchDataTable() {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData(profileId.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewChangeNameUpdateDelete(empType.value) + `${id}`
);
await fetchData(profileId.value);
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ดูการเปลี่ยนแปลงของข้อมูลฟอร์ท เปลี่ยนชื่อ-นามสกุล*/

View file

@ -31,6 +31,7 @@ const {
messageError,
success,
pathRegistryEmp,
dialogRemove,
} = useCounterMixin();
/** props*/
@ -508,18 +509,21 @@ async function fetchDataHistory() {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchDataCouple();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileFamilyUpdateDelete(empType.value, "children") +
`${id}`
);
await fetchDataChildren();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/

View file

@ -36,6 +36,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = mixin;
const id = ref<string>(route.params.id.toString()); //id profile
@ -576,19 +577,21 @@ async function fetchDataHistory() {
}
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData(profileId.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
function handleDelete(rowId: string) {
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileEducationUpdateDelete(empType.value) + `${rowId}`
);
await fetchData(id.value);
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ฟังก์ค้นหาข้อมูลรายการประวัติการศึกษา */

View file

@ -30,6 +30,7 @@ const {
date2Thai,
pathRegistryEmp,
onSearchDataTable,
dialogRemove,
} = mixin;
const id = ref<string>(route.params.id.toString()); //id profile
@ -404,18 +405,20 @@ function serchDataTable() {
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData(id.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileAbilityUpdateDelete(empType.value) + `${rowId}`
);
await fetchData(id.value);
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/

View file

@ -29,6 +29,7 @@ const {
pathRegistryEmp,
onSearchDataTable,
convertDateToAPI,
dialogRemove,
} = useCounterMixin();
const { createPathUploadFlie, getPathUploadFlie, uploadFile } =
useRegistryNewDataStore();
@ -336,18 +337,20 @@ function serchDataTable() {
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await getData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
dialogRemove($q, async () => {
showLoader();
try {
await http.patch(
config.API.profileNewNoPaidUpdateDelete(empType.value) + `${id}`
);
await getData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {
hideLoader();
}
});
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน */