diff --git a/packages/strapi-connector-mongoose/lib/mount-models.js b/packages/strapi-connector-mongoose/lib/mount-models.js index 17e3fd0f26..2d2771d0d4 100644 --- a/packages/strapi-connector-mongoose/lib/mount-models.js +++ b/packages/strapi-connector-mongoose/lib/mount-models.js @@ -440,47 +440,13 @@ const buildRelation = ({ definition, model, instance, attribute, name }) => { break; } case 'morphOne': { - // const FK = _.find(definition.associations, { - // alias: name, - // }); - - // const ref = getRef(attribute.model, attribute.plugin); - - // setField(name, { - // type: 'virtual', - // ref, - // via: `${FK.via}.ref`, - // justOne: true, - // }); - - // // Set this info to be able to see if this field is a real database's field. - // attribute.isVirtual = true; - const ref = getRef(attribute.model, attribute.plugin); - setField(name, { type: ObjectId, ref }); - break; } case 'morphMany': { - // const FK = _.find(definition.associations, { - // alias: name, - // }); - // const ref = getRef(attribute.collection, attribute.plugin); - - // setField(name, { - // type: 'virtual', - // ref, - // via: `${FK.via}.ref`, - // }); - - // // Set this info to be able to see if this field is a real database's field. - // attribute.isVirtual = true; - const ref = getRef(attribute.collection, attribute.plugin); - setField(name, [{ type: ObjectId, ref }]); - break; } diff --git a/packages/strapi-connector-mongoose/lib/relations.js b/packages/strapi-connector-mongoose/lib/relations.js index aee8aee80b..8039db0496 100644 --- a/packages/strapi-connector-mongoose/lib/relations.js +++ b/packages/strapi-connector-mongoose/lib/relations.js @@ -463,10 +463,8 @@ module.exports = { return; } - case 'oneMorphToOne': case 'oneMorphToMany': { - // TODO: to implement return; } }