mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 14:48:02 -05:00
update search when query param updates
This commit is contained in:
@@ -181,6 +181,11 @@ const recipes = ref([] as RecipeOverview[])
|
|||||||
const selectedCustomFilter = ref({} as CustomFilter)
|
const selectedCustomFilter = ref({} as CustomFilter)
|
||||||
const newFilterName = ref('')
|
const newFilterName = ref('')
|
||||||
|
|
||||||
|
// handle query updates when using the GlobalSearchDialog on the search page directly
|
||||||
|
watch(() => route.query, () => {
|
||||||
|
urlSearchParams.query = route.query.query
|
||||||
|
searchRecipes({page: urlSearchParams.page})
|
||||||
|
}, {deep: true})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if(urlSearchParams.page == undefined){
|
if(urlSearchParams.page == undefined){
|
||||||
urlSearchParams.page = 1
|
urlSearchParams.page = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user