Skip to content

Commit

Permalink
Merge pull request #49 from VirtusLab/fix/query-limits
Browse files Browse the repository at this point in the history
fix: drop query limits in the service
  • Loading branch information
cyp3rius authored Mar 16, 2021
2 parents 2e1fca7 + 6c9dc56 commit d2dff1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strapi-plugin-navigation",
"version": "1.0.0-beta.18",
"version": "1.0.0-beta.19",
"description": "Strapi - Navigation plugin",
"strapi": {
"name": "Navigation",
Expand Down
10 changes: 8 additions & 2 deletions services/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ module.exports = {
if (additionalFields.includes(configAdditionalFields.AUDIENCE)) {
const audienceItems = await strapi
.query(audienceModel.modelName, pluginName)
.find({});
.find({
_limit: -1,
});
extendedResult = {
...extendedResult,
availableAudience: audienceItems.map((_) =>
Expand Down Expand Up @@ -156,7 +158,9 @@ module.exports = {
const { pluginName, masterModel } = utilsFunctions.extractMeta(strapi.plugins);
const entities = await strapi
.query(masterModel.modelName, pluginName)
.find({}, []);
.find({
_limit: -1,
}, []);
return entities.map((_) => sanitizeEntity(_, { model: masterModel }));
},

Expand All @@ -171,6 +175,7 @@ module.exports = {
.query(itemModel.modelName, pluginName)
.find({
master: id,
_limit: -1,
_sort: 'order:asc',
}, ['related', 'audience']);

Expand Down Expand Up @@ -259,6 +264,7 @@ module.exports = {
{
master: entity.id,
...itemCriteria,
_limit: -1,
_sort: 'order:asc',
},
["related", "audience"],
Expand Down

0 comments on commit d2dff1c

Please sign in to comment.