mirror of
https://github.com/flarum/core.git
synced 2025-07-19 15:51:16 +02:00
Allow adding page
parameters to PaginatedListState, like limit
. (#2935)
This commit is contained in:
@@ -92,7 +92,10 @@ export default abstract class PaginatedListState<T extends Model> {
|
|||||||
*/
|
*/
|
||||||
protected loadPage(page = 1): Promise<T[]> {
|
protected loadPage(page = 1): Promise<T[]> {
|
||||||
const params = this.requestParams();
|
const params = this.requestParams();
|
||||||
params.page = { offset: this.pageSize * (page - 1) };
|
params.page = {
|
||||||
|
offset: this.pageSize * (page - 1),
|
||||||
|
...params.page,
|
||||||
|
};
|
||||||
|
|
||||||
if (Array.isArray(params.include)) {
|
if (Array.isArray(params.include)) {
|
||||||
params.include = params.include.join(',');
|
params.include = params.include.join(',');
|
||||||
|
Reference in New Issue
Block a user