update เกษียณ + ปิด route หน้ารายละเอียดถึงแก่กรรม

This commit is contained in:
Warunee Tamkoo 2023-07-25 21:14:52 +07:00
parent d08b3625f3
commit 97b5e63813
4 changed files with 36 additions and 39 deletions

View file

@ -16,7 +16,10 @@ const id = route.params.id;
const props = defineProps({
retireld: String,
listId: String,
UpdateListId: Function,
UpdateListId: {
type: Function,
default: () => console.log("UpdateListId"),
},
});
const modal = ref<boolean>(false);
@ -125,11 +128,8 @@ watch(modal, () => {
fecthlistRetire();
}
});
const updateListId = (val: any) => {
listId.value = val;
if (props.UpdateListId) {
props.UpdateListId(listId.value);
}
const updateListData = (retireld: string, pId: string) => {
props.UpdateListId(retireld, pId);
};
const fecthlistRetire = async () => {
showLoader();
@ -199,12 +199,12 @@ const clickAdd = (props: any) => {
persistent: true,
})
.onOk(async () => {
console.log("เพิ่มข้อมูล");
// console.log("");
await http
.put(config.API.profileRetire(retireld.value), { profileId: data })
.then((res) => {
success($q, "เพิ่มข้อมูลสำเร็จ");
updateListId(data);
updateListData(retireld.value, data);
})
.catch((e) => {
messageError($q, e);