new loader

This commit is contained in:
Thanit Konmek 2023-06-09 14:25:41 +07:00
parent fd7aae2f5d
commit fe6c712a18
95 changed files with 1189 additions and 950 deletions

View file

@ -161,7 +161,7 @@ const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const route = useRoute();
const { success, messageError } = mixin;
const { success, messageError, showLoader, hideLoader } = mixin;
const profileId = ref<string>(route.params.id.toString());
const edit = ref<boolean>(false);
const uploader = ref<any>();
@ -174,7 +174,7 @@ onMounted(async () => {
});
const getData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profilePaperId(profileId.value))
.then((res) => {
@ -185,12 +185,12 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const deleteData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profilePaperId(id))
.then((res) => {
@ -212,7 +212,7 @@ const uploadData = async () => {
});
const formData = new FormData();
formData.append("", newFile);
loaderPage(true);
showLoader();
await http
.post(config.API.profilePaperId(profileId.value), formData)
.then((res) => {