update search when query param updates

This commit is contained in:
vabene1111
2025-03-29 08:51:54 +01:00
parent 8827e6f453
commit d38a4a2e7e

View File

@@ -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