mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: redirect non-staff user to homepage when deleting own topic (#13267)
This commit is contained in:
parent
4134173bbf
commit
b27674597c
@ -20,7 +20,7 @@ import getURL from "discourse-common/lib/get-url";
|
|||||||
import { longDate } from "discourse/lib/formatter";
|
import { longDate } from "discourse/lib/formatter";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { resolveShareUrl } from "discourse/helpers/share-url";
|
import { resolveShareUrl } from "discourse/helpers/share-url";
|
||||||
import { userPath } from "discourse/lib/url";
|
import DiscourseURL, { userPath } from "discourse/lib/url";
|
||||||
|
|
||||||
export function loadTopicView(topic, args) {
|
export function loadTopicView(topic, args) {
|
||||||
const data = deepMerge({}, args);
|
const data = deepMerge({}, args);
|
||||||
@ -424,6 +424,9 @@ const Topic = RestModel.extend({
|
|||||||
"details.can_delete": false,
|
"details.can_delete": false,
|
||||||
"details.can_recover": true,
|
"details.can_recover": true,
|
||||||
});
|
});
|
||||||
|
if (!deleted_by.staff) {
|
||||||
|
DiscourseURL.redirectTo("/");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(popupAjaxError);
|
.catch(popupAjaxError);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user