From 3a7050d6c4b2db7abfb5366a10739eb637a5fb23 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 4 Jul 2024 22:57:24 +0200 Subject: [PATCH] feat: solve ItemFixedFilterPanel --- src/components/ui/VnFilterPanel.vue | 1 + src/pages/Item/ItemFixedPriceFilter.vue | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) 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] }, +});