#2069 bug-fix ticket scope days
gitea/salix/2069-ticket_index_scope_days This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-02-05 08:23:23 +01:00
parent 5a90c9a2d8
commit bee814f6a6
1 changed files with 6 additions and 7 deletions

View File

@ -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();
}