Skip to content

Commit a5c77e3

Browse files
authored
Update ListMixin.js
1 parent 91c46ed commit a5c77e3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

templates/vue-common/mixins/ListMixin.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export default {
99
return {
1010
options: {
1111
sortBy: [],
12-
descending: false,
1312
page: 1,
1413
itemsPerPage: 15
1514
},
@@ -32,8 +31,7 @@ export default {
3231
},
3332

3433
methods: {
35-
onUpdateOptions(props) {
36-
const { page, itemsPerPage, sortBy, sortDesc, descending, totalItems } = props;
34+
onUpdateOptions({ page, itemsPerPage, sortBy, sortDesc, totalItems } = {}) {
3735
let params = {
3836
...this.filters
3937
};
@@ -50,13 +48,13 @@ export default {
5048
vueDescending = sortDescVuetify;
5149
}
5250

53-
if (!isEmpty(sortBy)) {
54-
params[`order[${sortBy}]`] = vueDescending ? 'desc' : 'asc';
51+
if (!isEmpty(sortBy) && !isEmpty(sortDesc)) {
52+
params[`order[${sortBy[0]}]`] = sortDesc[0] ? 'desc' : 'asc'
5553
}
5654

5755
this.getPage(params).then(() => {
5856
this.options.sortBy = sortBy;
59-
this.options.descending = descending;
57+
this.options.sortDesc = sortDesc;
6058
this.options.itemsPerPage = itemsPerPage;
6159
this.options.totalItems = totalItems;
6260
});

0 commit comments

Comments
 (0)