mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
some cleanup
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
parent
c7f10bfede
commit
be24f640d9
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -463,10 +463,8 @@ module.exports = {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case 'oneMorphToOne':
|
||||
case 'oneMorphToMany': {
|
||||
// TODO: to implement
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user