From bee814f6a637251dbfc98a30cc5e408628e3afd8 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Wed, 5 Feb 2020 08:23:23 +0100 Subject: [PATCH 1/2] #2069 bug-fix ticket scope days --- modules/ticket/front/index/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/ticket/front/index/index.js b/modules/ticket/front/index/index.js index 9cf1c5483..41ebe655b 100644 --- a/modules/ticket/front/index/index.js +++ b/modules/ticket/front/index/index.js @@ -51,14 +51,13 @@ export default class Controller { onSearch(params) { if (params) { - let newParams = params; - if (params.scopeDays) { - const scopeDates = this.getScopeDates(params.scopeDays); - Object.assign(newParams, scopeDates); - } else if (Object.entries(params).length == 0) - newParams = this.getScopeDates(1); + if (typeof(params.scopeDays) === 'number') + Object.assign(params, this.getScopeDates(params.scopeDays)); + // Set default params to 0 scope days + else if (Object.entries(params).length == 0) + params = this.getScopeDates(1); - this.$.model.applyFilter(null, newParams); + this.$.model.applyFilter(null, params); } else this.$.model.clear(); } From 218ed38b5413dd147fbc7c3a9d1acbc58842c946 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Wed, 5 Feb 2020 08:24:29 +0100 Subject: [PATCH 2/2] changed comment --- modules/ticket/front/index/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/index/index.js b/modules/ticket/front/index/index.js index 41ebe655b..05dc23c08 100644 --- a/modules/ticket/front/index/index.js +++ b/modules/ticket/front/index/index.js @@ -53,7 +53,7 @@ export default class Controller { if (params) { if (typeof(params.scopeDays) === 'number') Object.assign(params, this.getScopeDates(params.scopeDays)); - // Set default params to 0 scope days + // Set default params to 1 scope days else if (Object.entries(params).length == 0) params = this.getScopeDates(1);