mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Cleaned up onValidate method on settings model
no-issue Explicit arguments and async/await make this nicer on the eyes
This commit is contained in:
parent
dd270b399c
commit
774187ced5
@ -122,13 +122,9 @@ Settings = ghostBookshelf.Model.extend({
|
||||
model.emitChange(model.attributes.key + '.' + 'edited', options);
|
||||
},
|
||||
|
||||
onValidate: function onValidate() {
|
||||
const self = this;
|
||||
|
||||
return ghostBookshelf.Model.prototype.onValidate.apply(this, arguments)
|
||||
.then(function then() {
|
||||
return validation.validateSettings(getDefaultSettings(), self);
|
||||
});
|
||||
async onValidate(model, attr, options) {
|
||||
await ghostBookshelf.Model.prototype.onValidate.call(this, model, attr, options);
|
||||
await validation.validateSettings(getDefaultSettings(), model);
|
||||
},
|
||||
|
||||
format() {
|
||||
|
Loading…
Reference in New Issue
Block a user