diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 795cd6d..91decc3 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -53,13 +53,15 @@ async function fetchCheckTime() { const notiTrigger = ref(false) const notiList = ref([]) +const totalNotiList = ref(0) /** function เรียกข้อมุลแจ้งเตือน */ async function fetchNotifications() { showLoader() await http .get(config.API.msgNotificate) .then((res) => { - const response = res.data.result + const response = res.data.result.data + totalNotiList.value = res.data.result.total const list: notiType[] = [] response.map((e: any) => { list.push({ @@ -236,7 +238,7 @@ function validateForm() { } if (hasError.every((result) => result === true)) { confirm() - } + } } const timeChickin = ref() @@ -349,17 +351,17 @@ onMounted(async () => { flat size="13px" class="q-mx-md" - :disable="notiList.length === 0" + :disable="totalNotiList == 0" > {{ notiList.length }}{{ totalNotiList }}