mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Fix find relation list for compo
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
3ff5f645c8
commit
1b460c76ff
@ -286,6 +286,8 @@ module.exports = {
|
||||
const { model, targetField } = ctx.params;
|
||||
const { _component, ...query } = ctx.request.query;
|
||||
|
||||
const contentManagerServices = strapi.plugins['content-manager'].services;
|
||||
|
||||
if (!targetField) {
|
||||
return ctx.badRequest();
|
||||
}
|
||||
@ -307,7 +309,7 @@ module.exports = {
|
||||
return ctx.notFound('target.notFound');
|
||||
}
|
||||
|
||||
const contentManagerService = strapi.plugins['content-manager'].services.contentmanager;
|
||||
const contentManagerService = contentManagerServices.contentmanager;
|
||||
|
||||
let entities = [];
|
||||
|
||||
@ -321,9 +323,9 @@ module.exports = {
|
||||
return ctx.notFound();
|
||||
}
|
||||
|
||||
const modelConfig = await strapi.plugins[
|
||||
'content-manager'
|
||||
].services.contenttypes.getConfiguration(model);
|
||||
const modelConfig = _component
|
||||
? await contentManagerServices.components.getConfiguration(modelDef.uid)
|
||||
: await contentManagerServices.contenttypes.getConfiguration(modelDef.uid);
|
||||
|
||||
const field = _.get(modelConfig, `metadatas.${targetField}.edit.mainField`, 'id');
|
||||
const pickFields = [field, 'id', target.primaryKey];
|
||||
|
Loading…
x
Reference in New Issue
Block a user