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 NewController extends Controller {
|
|
|
|
@alias('model')
|
|
|
|
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
|
|
|
}
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|