FIX: Can't add categories when creating a new web hook.

This commit is contained in:
Guo Xiang Tan
2017-01-09 11:22:35 +08:00
parent 95d1ad1ab8
commit c260a4e34d
3 changed files with 14 additions and 7 deletions

View File

@ -65,10 +65,16 @@ export default Ember.Controller.extend({
this.set('saved', false);
const url = extractDomainFromUrl(this.get('model.payload_url'));
const model = this.get('model');
const isNew = model.get('isNew');
const saveWebHook = () => {
return model.save().then(() => {
this.set('saved', true);
this.get('adminWebHooks').get('model').addObject(model);
if (isNew) {
this.transitionToRoute('adminWebHooks.show', model.get('id'));
}
}).catch(popupAjaxError);
};