diff --git a/packages/core/strapi/lib/services/__tests__/entity-service.test.js b/packages/core/strapi/lib/services/__tests__/entity-service.test.js index 32656e2547..3a2dc8d0d9 100644 --- a/packages/core/strapi/lib/services/__tests__/entity-service.test.js +++ b/packages/core/strapi/lib/services/__tests__/entity-service.test.js @@ -71,7 +71,7 @@ describe('Entity service', () => { expect(fakeStrapi.getModel).toHaveBeenCalledWith('test-model'); expect(fakeDB.query).toHaveBeenCalledWith('test-model'); - expect(fakeQuery.findOne).toHaveBeenCalledWith({}); + expect(fakeQuery.findOne).toHaveBeenCalledWith({ limit: 10 }); expect(result).toEqual(data); }); }); diff --git a/packages/core/strapi/lib/services/entity-service/index.js b/packages/core/strapi/lib/services/entity-service/index.js index 1ff0401ab6..a2dc4d413a 100644 --- a/packages/core/strapi/lib/services/entity-service/index.js +++ b/packages/core/strapi/lib/services/entity-service/index.js @@ -23,7 +23,7 @@ const { MANY_RELATIONS } = relationsUtils.constants; // TODO: those should be strapi events used by the webhooks not the other way arround const { ENTRY_CREATE, ENTRY_UPDATE, ENTRY_DELETE } = webhookUtils.webhookEvents; -const paginateAndTransformToQuery = (uid, opts) => { +const paginateAndTransformToQuery = (uid, opts = {}) => { // Paginate the opts const paginatedOpts = paginationUtils.withDefaultPagination(opts);