Add removing sort by click

This commit is contained in:
Stanislav Romanov 2022-04-15 17:42:17 +03:00
parent e99b771c28
commit 754c976735

View file

@ -38,7 +38,9 @@ export default class AdminIndexesItemDataController extends Controller {
@action
onSort(newSort) {
if (`${newSort}:asc` === this.sort) {
if (`${newSort}:desc` === this.sort) {
this.sort = null;
} else if (`${newSort}:asc` === this.sort) {
this.sort = `${newSort}:desc`;
} else {
this.sort = `${newSort}:asc`;