My current API need page[number]
and page[size]
as input for the pagination.
Here is where I am at the moment :
Route
queryParams: {
page:{
number: {refreshModel: true},
size: {refreshModel: true}
}
sort: {refreshModel: true},
direction: {refreshModel: true}
}
Controller
queryParams: ['sort','direction'{page: ['number','size']}],
page:{
number: 1,
size: 20
},
sort: 'created_at'
This part works, as the URL generated correctly include page[number]=1&page[size]=20
, and the data is retrieved and display as planned.
My problem is with the pagination links.
This is my usual helper when the number value is page
and not page[number]
, i is the target page number:
{{link-to i model-name (query-params page=i)}}
And this is my problem, I do not know what param to give to the query-params helper to modify page[number] and not page. How can I make a working pagination link in this configuration?