mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 12:44:43 +08:00
FEATURE: Webhooks.
This commit is contained in:

committed by
Guo Xiang Tan

parent
1f70fc9e11
commit
9ce61b4586
@ -0,0 +1,26 @@
|
||||
export default Discourse.Route.extend({
|
||||
serialize(model) {
|
||||
return { web_hook_id: model.get('id') || 'new' };
|
||||
},
|
||||
|
||||
model(params) {
|
||||
if (params.web_hook_id === 'new') {
|
||||
return this.store.createRecord('web-hook');
|
||||
}
|
||||
return this.store.find('web-hook', Ember.get(params, 'web_hook_id'));
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
if (model.get('isNew') || Ember.isEmpty(model.get('web_hook_event_types'))) {
|
||||
model.set('web_hook_event_types', controller.get('defaultEventTypes'));
|
||||
}
|
||||
|
||||
model.set('category_ids', model.get('category_ids'));
|
||||
model.set('group_ids', model.get('group_ids'));
|
||||
controller.setProperties({ model, saved: false });
|
||||
},
|
||||
|
||||
renderTemplate() {
|
||||
this.render('admin/templates/web-hooks-show', { into: 'admin' });
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user