2021-10-18 15:46:29 +03:00
|
|
|
import Controller from '@ember/controller';
|
2022-02-01 12:34:03 +03:00
|
|
|
import classic from 'ember-classic-decorator';
|
|
|
|
import {action} from '@ember/object';
|
2021-10-18 15:46:29 +03:00
|
|
|
import {alias} from '@ember/object/computed';
|
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@classic
|
|
|
|
export default class EditController extends Controller {
|
|
|
|
@alias('model')
|
2022-02-10 13:41:36 +03:00
|
|
|
webhook;
|
2021-10-18 15:46:29 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@action
|
|
|
|
save() {
|
|
|
|
return this.webhook.save();
|
|
|
|
}
|
2021-10-18 15:46:29 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@action
|
|
|
|
cancel() {
|
|
|
|
// 'new' route's dectivate hook takes care of rollback
|
|
|
|
return this.webhook.get('integration').then((integration) => {
|
|
|
|
this.transitionToRoute('settings.integration', integration);
|
|
|
|
});
|
|
|
|
}
|
2021-10-18 15:46:29 +03:00
|
|
|
|
|
|
|
reset() {
|
|
|
|
this.webhook.rollbackAttributes();
|
|
|
|
this.webhook.errors.clear();
|
|
|
|
}
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|