From f484b4d66edab46dacc381cb21ee905b787aac01 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Thu, 25 Jul 2019 17:06:02 +0200 Subject: [PATCH] Make groups non repeatable by default --- packages/strapi-hook-bookshelf/lib/queries.js | 4 ++-- packages/strapi-hook-mongoose/lib/queries.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/strapi-hook-bookshelf/lib/queries.js b/packages/strapi-hook-bookshelf/lib/queries.js index 83aecfeaba..f2ffd9c2e5 100644 --- a/packages/strapi-hook-bookshelf/lib/queries.js +++ b/packages/strapi-hook-bookshelf/lib/queries.js @@ -237,7 +237,7 @@ module.exports = function createQueryBuilder({ model, modelKey, strapi }) { for (let key of groupKeys) { const attr = model.attributes[key]; - const { group, required = false, repeatable = true } = attr; + const { group, required = false, repeatable = false } = attr; const groupModel = strapi.groups[group]; @@ -294,7 +294,7 @@ module.exports = function createQueryBuilder({ model, modelKey, strapi }) { if (!_.has(values, key)) continue; const attr = model.attributes[key]; - const { group, repeatable = true } = attr; + const { group, repeatable = false } = attr; const groupModel = strapi.groups[group]; diff --git a/packages/strapi-hook-mongoose/lib/queries.js b/packages/strapi-hook-mongoose/lib/queries.js index ae8f50a53f..6764f4d680 100644 --- a/packages/strapi-hook-mongoose/lib/queries.js +++ b/packages/strapi-hook-mongoose/lib/queries.js @@ -38,7 +38,7 @@ module.exports = ({ model, modelKey, strapi }) => { for (let key of groupKeys) { const attr = model.attributes[key]; - const { group, required = false, repeatable = true } = attr; + const { group, required = false, repeatable = false } = attr; const groupModel = strapi.groups[group]; @@ -89,7 +89,7 @@ module.exports = ({ model, modelKey, strapi }) => { if (!_.has(values, key)) continue; const attr = model.attributes[key]; - const { group, repeatable = true } = attr; + const { group, repeatable = false } = attr; const groupModel = strapi.groups[group]; const groupValue = values[key];