mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
Fix morph populate related.related
This commit is contained in:
parent
63f55d1cbf
commit
9f04a97bee
@ -536,11 +536,11 @@ module.exports = ({ models, target, plugin = false }, ctx) => {
|
||||
|
||||
const formatPolymorphicPopulate = ({ assoc, path, prefix = '' }) => {
|
||||
if (_.isString(path) && path === assoc.via) {
|
||||
return `related.${assoc.via}`;
|
||||
return { [`related.${assoc.via}`]: () => {} };
|
||||
} else if (_.isString(path) && path === assoc.alias) {
|
||||
// MorphTo side.
|
||||
if (assoc.related) {
|
||||
return `${prefix}${assoc.alias}.related`;
|
||||
return { [`${prefix}${assoc.alias}.related`]: () => {} };
|
||||
}
|
||||
|
||||
// oneToMorph or manyToMorph side.
|
||||
|
Loading…
x
Reference in New Issue
Block a user