Skip to content

Commit

Permalink
fix: reset page number on sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-webkul committed Aug 30, 2023
1 parent ec17aca commit a434f58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@
order: this.applied.sort.order === 'asc' ? 'desc' : 'asc',
};
/**
* When the sorting changes, we need to reset the page.
*/
this.applied.pagination.page = 1;
this.get();
}
},
Expand Down Expand Up @@ -579,7 +584,12 @@
indices: this.applied.massActions.indices
})
.then(response => {
this.$emitter.emit('add-flash', { type: 'success', message: response.data.data.message });
this.get();
})
.catch((error) => {
this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.data.message });
});
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@
order: this.applied.sort.order === 'asc' ? 'desc' : 'asc',
};
/**
* When the sorting changes, we need to reset the page.
*/
this.applied.pagination.page = 1;
this.get();
}
},
Expand Down

0 comments on commit a434f58

Please sign in to comment.