Pagination with bracket params

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?

i’m not sure if this would work but you could try:

{{link-to i model-name (query-params page=(hash number=1 size=10))}}

That said there is no reason you need to structure your Ember query params the same as your API query params. I guess maybe it’s less legwork in your model hook that way? But as long as you can get the params in whatever format they are in the Ember route/controller and then translate those properly to the backend request it doesn’t matter how you bind them on the Ember side.