ember-cli-pagination
ember-cli-pagination copied to clipboard
Add: support for nested pagination meta data
As the name states I needed to support this for a project I'm working on as the meta data for pagination doesn't necessarily have to lie in the root of the meta object.
Example:
{
"authors": [
{
"id": "1",
...
}
],
"meta": {
"pagination": {
"total": 120,
"count": 25,
"per_page": 25,
"current_page": 1,
"total_pages": 5,
"links": {
"next": "http://..."
}
}
}
}
The mapping would then be added to paramMapping for this example like this:
params.paramMapping = { meta: "pagination" };
I suppose I could write tests for this too if I have more time. Take your time, review the code and let me know how you want to continue.
Regards, David