From 177363ac6059964863f53df96033aa489a584499 Mon Sep 17 00:00:00 2001 From: Suven-p Date: Mon, 28 Oct 2024 05:50:50 +0545 Subject: [PATCH] Revert "Delete query params if empty" This reverts commit 2e18a19a9e5c000f7900f08cea7c607bf333cb22. --- src/components/MonitorList.vue | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue index f91f6878..303e284c 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -198,15 +198,11 @@ export default { return this.$route.query.searchText || ""; }, set(value) { - const newQuery = { - ...this.$route.query, - searchText: value, - }; - if (!value) { - delete newQuery.searchText; - } this.$router.replace({ - query: newQuery, + query: { + ...this.$route.query, + searchText: value, + } }); } }, @@ -290,22 +286,13 @@ export default { * @returns {void} */ updateFilter(newFilter) { - let newQuery = { - ...this.$route.query, - ...newFilter, - }; - if (!newFilter.status || newFilter.status.length === 0) { - delete newQuery.status; - } - if (!newFilter.active || newFilter.active.length === 0) { - delete newQuery.active; - } - if (!newFilter.tags || newFilter.tags.length === 0) { - delete newQuery.tags; - } - this.$router.replace({ - query: newQuery, + query: { + ...this.$route.query, + status: newFilter.status, + active: newFilter.active, + tags: newFilter.tags, + }, }); }, /**