Fix get nature

This commit is contained in:
Jim Laurie 2017-10-23 10:51:11 +02:00
parent e6a1cef7b1
commit 6abfea789e
2 changed files with 8 additions and 4 deletions

View File

@ -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);

View File

@ -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 {