fix: 🐛 Fix breaking change for changing page size (#2398)
This commit is contained in:
1 parent
bea40ec622
commit
ec59ee2b1c
2 files changed
+10
No files matched your search
@@ -10,4 +10,5 @@
|
||||
@route={{this.router.currentRouteName}}
|
||||
@model={{@model}}
|
||||
@queryFunction={{this.paginationQueryParams}}
|
||||
@onPageSizeChange={{this.handlePageSizeChange}}
|
||||
/>
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import Component from '@glimmer/component';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
|
||||
export default class RosePaginationComponent extends Component {
|
||||
@service router;
|
||||
@@ -21,4 +22,12 @@ export default class RosePaginationComponent extends Component {
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@action
|
||||
async handlePageSizeChange(pageSize) {
|
||||
// Reset to the first page when changing the page size
|
||||
const queryParams = { page: 1, pageSize };
|
||||
|
||||
await this.router.transitionTo({ queryParams });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user