From ccb6d0d0f8c48c8127f0868ed9ff49e61fd6f0c9 Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Fri, 22 Nov 2024 13:44:43 +0200 Subject: [PATCH] fix: filter-from-to.vue set null at falsy input value [WTEL-5576](https://webitel.atlassian.net/browse/WTEL-5576) --- package.json | 2 +- src/modules/QueryFilters/components/filter-from-to.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 70acfdf06..9ae2cda1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webitel/ui-sdk", - "version": "24.12.4", + "version": "24.12.5", "private": false, "scripts": { "dev": "vite", diff --git a/src/modules/QueryFilters/components/filter-from-to.vue b/src/modules/QueryFilters/components/filter-from-to.vue index ebf6ae44f..28d29fc28 100644 --- a/src/modules/QueryFilters/components/filter-from-to.vue +++ b/src/modules/QueryFilters/components/filter-from-to.vue @@ -87,7 +87,8 @@ export default { }, async setFrom(value) { - const filterValue = { from: value, to: this.value.to }; + const from = value ? value : null; // if value is empty, set it to null + const filterValue = { from, to: this.value.to }; await this.setValue({ filter: this.filterQuery, value: filterValue }); await this.setValueToQuery({ filterQuery: `${this.filterQuery}From`, @@ -96,7 +97,8 @@ export default { }, async setTo(value) { - const filterValue = { from: this.value.from, to: value }; + const to = value ? value : null; // if value is empty, set it to null + const filterValue = { from: this.value.from, to }; await this.setValue({ filter: this.filterQuery, value: filterValue }); await this.setValueToQuery({ filterQuery: `${this.filterQuery}To`,