mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 15:19:00 +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') {
|
if (association.type === 'model') {
|
||||||
params.id = obj[association.alias];
|
params.id = obj[association.alias];
|
||||||
} else {
|
} 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.
|
// Get refering model.
|
||||||
const ref = attr.plugin ?
|
const ref = association.plugin ?
|
||||||
strapi.plugins[attr.plugin].models[params.model]:
|
strapi.plugins[association.plugin].models[params.model]:
|
||||||
strapi.models[params.model];
|
strapi.models[params.model];
|
||||||
|
|
||||||
// Apply optional arguments to make more precise nested request.
|
// Apply optional arguments to make more precise nested request.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user