diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 2ea51ed8b..70e36e1db 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -110,6 +110,7 @@ async function search(evt) { store.filter.where = {}; isLoading.value = true; + if (evt?.param) Object.assign(userParams.value, evt.param); const filter = { ...userParams.value }; store.userParamsChanged = true; arrayData.reset(['skip', 'filter.skip', 'page']); diff --git a/src/pages/Item/ItemFixedPriceFilter.vue b/src/pages/Item/ItemFixedPriceFilter.vue index 6fec09f37..4dd4d3b0a 100644 --- a/src/pages/Item/ItemFixedPriceFilter.vue +++ b/src/pages/Item/ItemFixedPriceFilter.vue @@ -24,12 +24,16 @@ const route = useRoute(); const itemTypeWorkersOptions = ref([]); const sanitizeParam = (param) => { - return JSON.parse(route.query.params)[param] ? 'true' : 'false'; + const params = JSON.parse(route.query.params); + return params[param] ?? 'false'; }; const $params = ref({}); onMounted(() => { ['mine', 'hasMinPrice'].forEach((tag) => ($params.value[tag] = sanitizeParam(tag))); }); +const pushParam = (param) => ({ + param: { [param]: $params.value[param] }, +});