Skip to content

Commit 5500b3e

Browse files
author
Guust
committed
move the sort 'filter' to fetchlogs, since it doesn't actually filter anything
1 parent 9c63409 commit 5500b3e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/public/views/Logs/Overview/LogsOverviewModel.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,18 @@ export class LogsOverviewModel extends Observable {
8080
*/
8181
async fetchLogs() {
8282
const keepExisting = this._pagination.currentPage > 1 && this._pagination.isInfiniteScrollEnabled;
83+
const sortOn = this._overviewSortModel.appliedOn;
84+
const sortDirection = this._overviewSortModel.appliedDirection;
8385

8486
if (!keepExisting) {
8587
this._logs = RemoteData.loading();
8688
this.notify();
8789
}
8890

8991
const params = {
92+
...sortOn && sortDirection && {
93+
[`sort[${sortOn}]`]: sortDirection,
94+
},
9095
...this._getFilterQueryParams(),
9196
'page[offset]': this._pagination.firstItemOffset,
9297
'page[limit]': this._pagination.itemsPerPage,
@@ -189,8 +194,6 @@ export class LogsOverviewModel extends Observable {
189194
* @private
190195
*/
191196
_getFilterQueryParams() {
192-
const sortOn = this._overviewSortModel.appliedOn;
193-
const sortDirection = this._overviewSortModel.appliedDirection;
194197
const titleFilter = this._filteringModel.get('titleFilter');
195198
const contentFilter = this._filteringModel.get('contentFilter');
196199
const authorFilter = this._filteringModel.get('authorFilter');
@@ -230,9 +233,6 @@ export class LogsOverviewModel extends Observable {
230233
'filter[lhcFills][values]': lhcFills.normalized,
231234
'filter[lhcFills][operation]': this.lhcFillFilterOperation.toLowerCase(),
232235
},
233-
...sortOn && sortDirection && {
234-
[`sort[${sortOn}]`]: sortDirection,
235-
},
236236
};
237237
}
238238
}

0 commit comments

Comments
 (0)