mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 06:35:47 +00:00
Fix get nature
This commit is contained in:
parent
e6a1cef7b1
commit
6abfea789e
@ -44,6 +44,10 @@ export function* submitChanges(action) {
|
||||
}
|
||||
|
||||
forEach(attribute.params, (value, key) => {
|
||||
if (key === 'dominant' && get(attribute.params, 'nature') !== 'manyToMany') {
|
||||
delete body.attributes[index].params.dominant;
|
||||
}
|
||||
|
||||
if (includes(key, 'Value')) {
|
||||
// Remove and set needed keys for params
|
||||
set(body.attributes[index].params, replace(key, 'Value', ''), value);
|
||||
|
||||
@ -169,8 +169,8 @@ module.exports = {
|
||||
};
|
||||
} else if ((types.current === 'model' || types.current === 'modelD') && types.other === 'collection') {
|
||||
return {
|
||||
nature: 'oneToMany',
|
||||
verbose: 'belongsTo'
|
||||
nature: 'manyToOne',
|
||||
verbose: 'hasMany'
|
||||
};
|
||||
} else if (types.current === 'modelD' && types.other === 'collection') {
|
||||
return {
|
||||
@ -179,8 +179,8 @@ module.exports = {
|
||||
};
|
||||
} else if (types.current === 'collection' && types.other === 'model') {
|
||||
return {
|
||||
nature: 'manyToOne',
|
||||
verbose: 'hasMany'
|
||||
nature: 'oneToMany',
|
||||
verbose: 'belongsTo'
|
||||
};
|
||||
} else if (types.current === 'collection' && types.other === 'collection') {
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user