mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +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);
|
model.emitChange(model.attributes.key + '.' + 'edited', options);
|
||||||
},
|
},
|
||||||
|
|
||||||
onValidate: function onValidate() {
|
async onValidate(model, attr, options) {
|
||||||
const self = this;
|
await ghostBookshelf.Model.prototype.onValidate.call(this, model, attr, options);
|
||||||
|
await validation.validateSettings(getDefaultSettings(), model);
|
||||||
return ghostBookshelf.Model.prototype.onValidate.apply(this, arguments)
|
|
||||||
.then(function then() {
|
|
||||||
return validation.validateSettings(getDefaultSettings(), self);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
format() {
|
format() {
|
||||||
|
Loading…
Reference in New Issue
Block a user