Skip to content

Commit

Permalink
can reset query on search error
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Apr 24, 2024
1 parent a373dd9 commit be4c963
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/search/SearchDocuments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@

<loader-status v-else :request-state="requestState">
<search-results-table :results="searchResults" @request="onRequest" @reload="search" />
<template #error>
<q-btn :label="t('search.form.customize_query.reset')"
size="md"
color="primary-dark"
class="q-ma-md"
@click="resetAndLoad" />
</template>
</loader-status>
</q-card>
</template>
Expand All @@ -85,6 +92,10 @@
import SearchExamples from './SearchExamples.vue'
const CodeEditor = defineAsyncComponent(() => import('../shared/CodeEditor.vue'))
const resetAndLoad = () => {
searchStore.resetSearchQuery()
search()
}
const t = useTranslation()
const {
Expand Down
4 changes: 4 additions & 0 deletions src/components/shared/LoaderStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
</q-btn>
</template>
</q-banner>

<div>
<slot name="error" />
</div>
</div>
</template>
<template v-else-if="requestState.networkError">
Expand Down

0 comments on commit be4c963

Please sign in to comment.