Skip to content

Commit

Permalink
fix: increase limit to 200
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Oct 30, 2020
1 parent 22ed856 commit 947a5f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/api-headless-cms/src/content/plugins/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default () => {
withFields({
id: context.commodo.fields.id()
}),
withStorage({ driver }),
withStorage({ driver, maxPerPage: 200 }),
withUser(context),
withSoftDelete(),
withCrudLogs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default async function findEntries<T = CmsContext>({
parseBoolean(args);
// eslint-disable-next-line prefer-const
let { limit, after, before } = args;
limit = isNaN(limit) || limit < 1 ? 100 : limit;
limit = isNaN(limit) || limit < 1 ? 200 : limit;

const { query, sort } = createFindParameters({
context,
Expand Down Expand Up @@ -80,8 +80,8 @@ export default async function findEntries<T = CmsContext>({
const locales = context.i18n.getLocales();
const newLimit = limit * locales.length;

// cap max limit to 100, to avoid `MAX_PER_PAGE_EXCEEDED` error
limit = Math.min(newLimit, 100);
// cap max limit to 200, to avoid `MAX_PER_PAGE_EXCEEDED` error
limit = Math.min(newLimit, 200);
}

// Find IDs using search collection
Expand Down

0 comments on commit 947a5f6

Please sign in to comment.