Skip to content

Commit

Permalink
Add spinnner
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissearle committed Sep 11, 2024
1 parent 293b43c commit bdd6cc1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions web/src/views/SearchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const filteredYear = ref<number | undefined>(undefined)
const filteredFormat = ref<string | undefined>(undefined)
const filteredLanguage = ref<string | undefined>(undefined)
const showSpinner = ref(false)
onMounted(() => {
performSearch()
})
Expand All @@ -33,12 +35,18 @@ const performSearch = () => {
query.languages = [filteredLanguage.value]
}
showSpinner.value = true
fetch('/api/search', {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(query)
}).then(response => response.json())
.then(res => data.value = res)
.then(res => {
data.value = res
showSpinner.value = false
})
}
const clear = () => {
Expand Down Expand Up @@ -85,6 +93,14 @@ const filterLanguage = (language: string) => {

<v-divider/>

<v-progress-circular
color="primary"
indeterminate
class="ma-16"
v-if="showSpinner"
></v-progress-circular>


<v-navigation-drawer
location="end"
name="drawer"
Expand All @@ -94,7 +110,7 @@ const filterLanguage = (language: string) => {
</v-navigation-drawer>
<div class="">
<div>
<div class="d-flex flex-row flex-wrap justify-center">
<SessionItem v-for="session in data?.sessionsResponse" :session="session"/>
</div>
Expand Down

0 comments on commit bdd6cc1

Please sign in to comment.