Skip to content

Commit

Permalink
fix: Restored filtering functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
MauritsioRK authored and john-ghatas committed May 16, 2020
1 parent 50ff984 commit 0df675a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/public/views/Logs/Logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Overview extends Observable {
this.model = model;
this.filterCriteria = [];
this.data = [];
this.filtered = [];
this.filteredData = [];
this.error = false;
}

Expand All @@ -40,7 +40,7 @@ export default class Overview extends Observable {

if (result.data) {
this.data = result.data;
this.filtered = [...result.data];
this.filteredData = result.data;
this.error = false;
} else {
this.error = true;
Expand Down Expand Up @@ -76,7 +76,7 @@ export default class Overview extends Observable {
* @returns {Array} Returns all of the data
*/
getData() {
return this.error ? null : this.data;
return this.error ? null : this.filteredData;
}

/**
Expand Down Expand Up @@ -106,7 +106,7 @@ export default class Overview extends Observable {
getFilteredData() {
this.filterCriteria.length !== 0
? this.filterByTags()
: this.filtered = [...this.data];
: this.filteredData = this.data;

this.notify();
}
Expand All @@ -116,7 +116,7 @@ export default class Overview extends Observable {
* @returns {Array} Sets the filtered data on the criteria applied by the user
*/
filterByTags() {
this.filtered = this.data.filter((entry) => this.checkExistingTag(entry));
this.filteredData = this.data.filter((entry) => this.checkExistingTag(entry));
}

/**
Expand Down

0 comments on commit 0df675a

Please sign in to comment.