Allow compo option

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-07-02 15:21:56 +02:00
parent 29fcf7c3cd
commit c31c86c8e5
2 changed files with 3 additions and 4 deletions

View File

@ -107,8 +107,7 @@
"config": {
"policies": [
"routing",
"admin::isAuthenticatedAdmin",
["plugins::content-manager.hasPermissions", ["plugins::content-manager.explorer.read"]]
"admin::isAuthenticatedAdmin"
]
}
},

View File

@ -278,13 +278,13 @@ module.exports = {
async findRelationList(ctx) {
const { model, targetField } = ctx.params;
const { query } = ctx.request;
const { _component, ...query } = ctx.request.query;
if (!targetField) {
return ctx.badRequest();
}
const modelDef = strapi.db.getModel(model);
const modelDef = _component ? strapi.db.getModel(_component) : strapi.db.getModel(model);
if (!modelDef) {
return ctx.notFound('model.notFound');