mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: call UserBadge.grant with badgeReason in admin interface (#23753)
Regression from https://github.com/discourse/discourse/pull/23668 where we stopped passing in `this.badgeReason` to the badge granting function. This PR fixes that and adds a unit test to cover that code path.
This commit is contained in:
@@ -73,8 +73,13 @@ export default class AdminUserBadgesController extends Controller {
|
||||
|
||||
@action
|
||||
performGrantBadge() {
|
||||
UserBadge.grant(this.selectedBadgeId, this.get("user.username")).then(
|
||||
UserBadge.grant(
|
||||
this.selectedBadgeId,
|
||||
this.get("user.username"),
|
||||
this.badgeReason
|
||||
).then(
|
||||
(newBadge) => {
|
||||
this.set("badgeReason", "");
|
||||
this.userBadges.pushObject(newBadge);
|
||||
next(() => {
|
||||
// Update the selected badge ID after the combobox has re-rendered.
|
||||
|
||||
Reference in New Issue
Block a user