mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +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 = '' }) => {
|
const formatPolymorphicPopulate = ({ assoc, path, prefix = '' }) => {
|
||||||
if (_.isString(path) && path === assoc.via) {
|
if (_.isString(path) && path === assoc.via) {
|
||||||
return `related.${assoc.via}`;
|
return { [`related.${assoc.via}`]: () => {} };
|
||||||
} else if (_.isString(path) && path === assoc.alias) {
|
} else if (_.isString(path) && path === assoc.alias) {
|
||||||
// MorphTo side.
|
// MorphTo side.
|
||||||
if (assoc.related) {
|
if (assoc.related) {
|
||||||
return `${prefix}${assoc.alias}.related`;
|
return { [`${prefix}${assoc.alias}.related`]: () => {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
// oneToMorph or manyToMorph side.
|
// oneToMorph or manyToMorph side.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user