From 4282463e51e8f140be44d5549297ad62ada548a7 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 26 Apr 2024 14:29:11 -0300 Subject: [PATCH] Fill filter fields with user params --- src/pages/Item/ItemListFilter.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages/Item/ItemListFilter.vue b/src/pages/Item/ItemListFilter.vue index f383a1e18..2e89cdbcf 100644 --- a/src/pages/Item/ItemListFilter.vue +++ b/src/pages/Item/ItemListFilter.vue @@ -127,6 +127,17 @@ onMounted(async () => { type: prop ? prop.type : null, }); }); + + // Fill fieldFiltersValues with existent userParams + if (arrayData.store?.userParams) { + fieldFiltersValues.value = Object.entries(arrayData.store?.userParams) + .filter(([key, value]) => value && _moreFields.includes(key)) + .map(([key, value]) => ({ + name: key, + value, + selectedField: moreFields.value.find((field) => field.name === key), + })); + } });