mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 07:42:48 +08:00
Notify index when a discussion is deleted from the discussion view
This commit is contained in:
parent
34885f0f9b
commit
be5bc07733
|
@ -6,7 +6,7 @@ import AlertMessage from 'flarum/components/ui/alert-message';
|
|||
import UseComposerMixin from 'flarum/mixins/use-composer';
|
||||
|
||||
export default Ember.Controller.extend(Ember.Evented, UseComposerMixin, {
|
||||
needs: ['application'],
|
||||
needs: ['application', 'index'],
|
||||
composer: Ember.inject.controller('composer'),
|
||||
alerts: Ember.inject.controller('alerts'),
|
||||
|
||||
|
@ -126,8 +126,9 @@ export default Ember.Controller.extend(Ember.Evented, UseComposerMixin, {
|
|||
|
||||
delete: function() {
|
||||
var controller = this;
|
||||
this.get('model').destroyRecord().then(function() {
|
||||
controller.transitionToRoute('index');
|
||||
var discussion = this.get('model');
|
||||
discussion.destroyRecord().then(function() {
|
||||
controller.get('controllers.index').send('discussionRemoved', discussion);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user