refactor: ♻️ Refactoring

This commit is contained in:
Maicol Battistini 2023-07-11 15:29:09 +02:00
parent b808fa50f0
commit 514a2112d5
No known key found for this signature in database
1 changed files with 1 additions and 2 deletions

View File

@ -303,7 +303,7 @@ export default abstract class RecordsPage<
onTablePageChange(event: CustomEvent<PaginateDetail>) { onTablePageChange(event: CustomEvent<PaginateDetail>) {
const {pageSize, action} = event.detail; const {pageSize, action} = event.detail;
this.currentPageSize = pageSize; this.currentPageSize = pageSize;
const currentPage = this.currentPage; const {currentPage} = this;
match(action) match(action)
.with('first', () => (this.currentPage = 1)) .with('first', () => (this.currentPage = 1))
.with('previous', () => (this.currentPage--)) .with('previous', () => (this.currentPage--))
@ -311,7 +311,6 @@ export default abstract class RecordsPage<
.with('last', () => (this.currentPage = this.lastPage)) .with('last', () => (this.currentPage = this.lastPage))
.with('current', () => {}) .with('current', () => {})
.run(); .run();
console.log('onTablePageChange', event.detail);
if (currentPage !== this.currentPage) { if (currentPage !== this.currentPage) {
this.refreshRecords = true; this.refreshRecords = true;
m.redraw(); m.redraw();