Skip to content

Commit eb9abec

Browse files
authored
Merge pull request #71 from devforth/fix-sort-to-query-binding
fix: change sort mutation to object reassign
2 parents 395439f + f44008d commit eb9abec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adminforth/spa/src/components/ResourceListTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ function onSortButtonClick(event, field) {
398398
} else {
399399
const sortField = sort.value[sortIndex];
400400
if (sortField.direction === 'asc') {
401-
sort.value[sortIndex].direction = 'desc';
401+
sort.value = sort.value.map((s) => s.field === field ? {field, direction: 'desc'} : s);
402402
} else {
403-
sort.value.splice(sortIndex, 1);
403+
sort.value = sort.value.filter((s) => s.field !== field);
404404
}
405405
}
406406
}

0 commit comments

Comments
 (0)