mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: deleting a flagged post issue
cf. http://meta.discourse.org/t/deleting-a-flagged-post-issue/10061 The bug was only happening when you were about the delete the first post, which means deleting the entire topic.
This commit is contained in:
@@ -46,12 +46,12 @@ Discourse.AdminFlagsController = Ember.ArrayController.extend({
|
||||
Deletes a post
|
||||
|
||||
@method deletePost
|
||||
@param {Discourse.FlaggedPost} item The post to delete
|
||||
@param {Discourse.FlaggedPost} post The post to delete
|
||||
**/
|
||||
deletePost: function(item) {
|
||||
deletePost: function(post) {
|
||||
var adminFlagsController = this;
|
||||
item.deletePost().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
post.deletePost().then((function() {
|
||||
adminFlagsController.removeObject(post);
|
||||
}), function() {
|
||||
bootbox.alert(I18n.t("admin.flags.error"));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user