Ghost/ghost/admin/app/routes/settings/integration/webhooks/edit.js
Kevin Ansfield 065182c586 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
2018-11-13 11:40:24 +00:00

15 lines
363 B
JavaScript

import Route from '@ember/routing/route';
export default Route.extend({
model(params) {
let integration = this.modelFor('settings.integration');
let webhook = integration.webhooks.findBy('id', params.webhook_id);
return webhook;
},
deactivate() {
this._super(...arguments);
this.controller.reset();
}
});