Merge branch 'master' into feature/groups

This commit is contained in:
Alexandre Bodin 2019-07-12 11:25:26 +02:00
commit dc8045778b
2 changed files with 11 additions and 13 deletions

View File

@ -21,7 +21,10 @@ To disable the prefix, add the `prefix` attribute to each concerned route, like
"method": "GET",
"path": "/my-plugin-route",
"handler": "MyPlugin.action",
"prefix": false
"config": {
"policies": [],
"prefix": false
}
}
```

View File

@ -329,22 +329,17 @@ module.exports = {
{}
);
await Promise.all(relationUpdates);
delete values[this.primaryKey];
if (!_.isEmpty(values)) {
relationUpdates.push(
this.forge({
[this.primaryKey]: getValuePrimaryKey(params, this.primaryKey),
}).save(values, {
patch: true,
})
);
} else {
relationUpdates.push(Promise.resolve(_.assign(response, params.values)));
await this.forge({
[this.primaryKey]: getValuePrimaryKey(params, this.primaryKey),
}).save(values, {
patch: true,
});
}
// Update virtuals fields.
await Promise.all(relationUpdates);
return await this.forge({
[this.primaryKey]: getValuePrimaryKey(params, this.primaryKey),
}).fetch({