fix: load skeleton

This commit is contained in:
setthawutttty 2025-08-15 11:00:12 +07:00
parent 016f9f0642
commit 01dc0ad348
5 changed files with 85 additions and 66 deletions

View file

@ -88,7 +88,7 @@ const visibleColumns = ref<string[]>(["scholarshipYear", "scholarshipType"]);
/** ดึงข้อมูล */
async function getData() {
showLoader();
await http
.get(
config.API.developmentScholarship +
@ -96,12 +96,13 @@ async function getData() {
)
.then(async (res) => {
rows.value = res.data.result;
isLoad.value = false
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
isLoad.value = false
});
}
@ -127,19 +128,20 @@ function onEdit(id: string) {
// );
async function getProfileId() {
isLoad.value = true
if (dataStore.profileId) {
profilId.value = dataStore.profileId;
} else {
isLoad.value = true;
try {
const res = await http.get(config.API.profilePosition());
dataStore.profileId = res.data.result.profileId;
profilId.value = dataStore.profileId;
isLoad.value = false;
} catch (e) {
messageError($q, e);
} finally {
isLoad.value = false;
}
}