Fixed sticky validation errors when editing webhooks
refs https://github.com/TryGhost/Ghost/issues/10137 - when closing the edit webhook modal we were rolling back the changed attributes of the webhook model but not clearing the errors object which meant a validation error was shown when re-opening the edit webhook modal - add `reset()` method to the webhook edit controller and call that when leaving the edit route instead of only rolling back the changed attributes
This commit is contained in:
parent
ac45494e69
commit
f884eb891d
|
@ -15,5 +15,10 @@ export default Controller.extend({
|
|||
this.transitionToRoute('settings.integration', integration);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.webhook.rollbackAttributes();
|
||||
this.webhook.errors.clear();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -9,6 +9,6 @@ export default Route.extend({
|
|||
|
||||
deactivate() {
|
||||
this._super(...arguments);
|
||||
this.controller.webhook.rollbackAttributes();
|
||||
this.controller.reset();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue