mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
correctly access the ref of the given model as param
This commit is contained in:
parent
be148bd5c5
commit
ba809f6149
@ -544,14 +544,9 @@ module.exports = {
|
||||
if (association.type === 'model') {
|
||||
params.id = obj[association.alias];
|
||||
} else {
|
||||
// Get attribute.
|
||||
const attr = association.plugin ?
|
||||
strapi.plugins[association.plugin].models[params.model].attributes[association.via]:
|
||||
strapi.models[params.model].attributes[association.via];
|
||||
|
||||
// Get refering model.
|
||||
const ref = attr.plugin ?
|
||||
strapi.plugins[attr.plugin].models[params.model]:
|
||||
const ref = association.plugin ?
|
||||
strapi.plugins[association.plugin].models[params.model]:
|
||||
strapi.models[params.model];
|
||||
|
||||
// Apply optional arguments to make more precise nested request.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user