ต่อ api delete notification

This commit is contained in:
AnandaTon 2023-09-11 12:13:24 +07:00
parent 7f47b78067
commit 7c957419ae
2 changed files with 17 additions and 14 deletions

View file

@ -39,6 +39,7 @@ const {
const DataStore = useroleUserDataStore();
const { fetchroleUser } = DataStore;
const id = ref<string>("");
const $q = useQuasar();
const { tabData, loader } = storeToRefs(store);
const { changeTab } = store;
@ -405,19 +406,20 @@ if (keycloak.tokenParsed != null) {
}
const deleteData = async (id: string) => {
await http;
// .delete(config.API.copyOrderId(id))
// .then((res) => {
// // const data = res.data.result;
// // console.log(res);
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// // hideLoader();
// });
console.log("delete=", id);
showLoader();
await http
.delete(config.API.msgId(id))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
getDataNotification();
hideLoader();
});
};
const clickDelete = (id: string) => {
@ -509,7 +511,7 @@ const clickDelete = (id: string) => {
dense
icon="mdi-close"
class="mybtn q-mx-xs"
@click="clickDelete"
@click="clickDelete(n.id)"
></q-btn>
</q-item>
<q-separator color="grey-2" />