mirror of
https://github.com/strapi/strapi.git
synced 2025-08-09 01:07:27 +00:00
Fixed ‘oneWay’ relation creating unnecessary attr
When ‘oneWay’ relation is created the target model file is also updated with a reference to the relation. This is not required for a oneWay relation since it never will or can be populated from the other way around.
This commit is contained in:
parent
0408368481
commit
ae29802c07
@ -201,6 +201,7 @@ module.exports = {
|
||||
};
|
||||
|
||||
switch (relation.nature) {
|
||||
case 'oneWay':
|
||||
case 'oneToOne':
|
||||
case 'manyToOne':
|
||||
attr.model = relation.target;
|
||||
@ -212,7 +213,9 @@ module.exports = {
|
||||
default:
|
||||
}
|
||||
|
||||
if(relation.nature !== 'oneWay') {
|
||||
attr.via = relation.key;
|
||||
}
|
||||
attr.dominant = relation.dominant;
|
||||
|
||||
if (_.trim(relation.pluginValue)) {
|
||||
@ -353,6 +356,8 @@ module.exports = {
|
||||
const attr = {};
|
||||
|
||||
switch (params.nature) {
|
||||
case 'oneWay':
|
||||
return;
|
||||
case 'oneToOne':
|
||||
case 'oneToMany':
|
||||
attr.model = model.toLowerCase();
|
||||
|
Loading…
x
Reference in New Issue
Block a user