update
This commit is contained in:
@@ -217,7 +217,7 @@
|
||||
<Loading v-if="pending"/>
|
||||
<Loading v-if="pending"/>
|
||||
<Loading v-if="pending"/>
|
||||
<div v-else v-for="(course, index) in data.courses" :key="index">
|
||||
<div v-else v-for="(course, index) in data?.courses" :key="index">
|
||||
<Card :course="course" />
|
||||
</div>
|
||||
|
||||
@@ -437,7 +437,7 @@ const { data, refresh, pending } = await useFetch(() => "/api/course", {
|
||||
|
||||
|
||||
|
||||
paginationLength.value = Math.ceil(data.value.count / 2);
|
||||
paginationLength.value = Math.ceil(data?.value?.count / 2);
|
||||
function changePage(page) {
|
||||
pageNumber.value = page;
|
||||
query.value = { ...route.query, page: pageNumber };
|
||||
@@ -591,7 +591,7 @@ const searchHandler = () =>{
|
||||
refresh();
|
||||
}
|
||||
watch(data , () => {
|
||||
paginationLength.value = Math.ceil(data.value.count / 2);
|
||||
paginationLength.value = Math.ceil(data?.value?.count / 2);
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user