Skip to content

Commit

Permalink
feat: enable loading when switching pages on search page
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Mar 22, 2024
1 parent 8b9f456 commit 5bd790e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const error = ref({ status: 0, message: '' })
const loading = ref(true)
const page = ref(1)
const totalItems = ref(0)
const isWindowScrolled = ref(false)
definePageMeta({
middleware: [
Expand All @@ -31,6 +32,7 @@ const q = computed(() => {
})
async function fetchData() {
loading.value = true
const results = await fetch(`/api/search?q=${ q.value }&page=${page.value}`)
if (!results.ok) {
Expand Down

0 comments on commit 5bd790e

Please sign in to comment.