mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Fixed mirage not respecting ?limit=all queries
no issue - the `paginatedResponse` helper util tries to convert strings to integers but had no logic for handling `'all'` so it would always default to 15 in that case
This commit is contained in:
parent
731d2a9a2e
commit
f015eeb430
@ -4,9 +4,13 @@ import {Response} from 'ember-cli-mirage';
|
||||
export function paginatedResponse(modelName) {
|
||||
return function (schema, request) {
|
||||
let page = +request.queryParams.page || 1;
|
||||
let limit = +request.queryParams.limit || 15;
|
||||
let limit = request.queryParams.limit;
|
||||
let collection = schema[modelName].all();
|
||||
|
||||
if (limit !== 'all') {
|
||||
limit = +request.queryParams.limit || 15;
|
||||
}
|
||||
|
||||
return paginateModelCollection(modelName, collection, page, limit);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user