diff --git a/src/modules/09_scholarship/views/detail.vue b/src/modules/09_scholarship/views/detail.vue index e0fe2a5..4f6fad9 100644 --- a/src/modules/09_scholarship/views/detail.vue +++ b/src/modules/09_scholarship/views/detail.vue @@ -1076,7 +1076,7 @@ onMounted(async () => {
ชื่อ-นามสกุล
{{ - dataGuarantor.firstName ? dataGuarantor.name : "-" + dataGuarantor.name ? dataGuarantor.name : "-" }}
ตำแหน่ง
diff --git a/src/modules/09_scholarship/views/main.vue b/src/modules/09_scholarship/views/main.vue index b2618b0..a22a888 100644 --- a/src/modules/09_scholarship/views/main.vue +++ b/src/modules/09_scholarship/views/main.vue @@ -79,49 +79,52 @@ const columns = ref([ const visibleColumns = ref(["scholarshipYear", "scholarshipType"]); /** ดึงข้อมูล */ -function getData() { - http +async function getData() { + showLoader(); + await http .get( config.API.developmentScholarship + `/user/${profilId.value}?year=${year.value}&type=${type.value}` ) - .then((res) => { + .then(async (res) => { rows.value = res.data.result; }) .catch((e) => { messageError($q, e); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); } function onEdit(id: string) { router.push(`/scholarship/${id}`); } -watch( - () => currentPage.value, - () => { - rowsPerPage.value = pagination.value.rowsPerPage; - getData(); - } -); +// watch( +// () => currentPage.value, +// () => { +// rowsPerPage.value = pagination.value.rowsPerPage; +// getData(); +// } +// ); -watch( - () => pagination.value.rowsPerPage, - () => { - rowsPerPage.value = pagination.value.rowsPerPage; - currentPage.value = 1; - getData(); - } -); +// watch( +// () => pagination.value.rowsPerPage, +// () => { +// rowsPerPage.value = pagination.value.rowsPerPage; +// currentPage.value = 1; +// getData(); +// } +// ); -function getProfileId() { +async function getProfileId() { showLoader(); - http + await http .get(config.API.profilePosition()) - .then((res) => { + .then(async (res) => { profilId.value = res.data.result.profileId; - getData(); + await getData(); }) .catch((e) => { messageError($q, e); @@ -147,7 +150,7 @@ function convertType(val: string) { } onMounted(async () => { - getProfileId(); + await getProfileId(); });