mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: show error msg on grant badge if message available from backend (#6801)
This commit is contained in:
parent
1381dc603d
commit
0fca3205b5
@ -1,4 +1,5 @@
|
||||
import GrantBadgeController from "discourse/mixins/grant-badge-controller";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default Ember.Controller.extend(GrantBadgeController, {
|
||||
adminUser: Ember.inject.controller(),
|
||||
@ -70,9 +71,8 @@ export default Ember.Controller.extend(GrantBadgeController, {
|
||||
}
|
||||
});
|
||||
},
|
||||
function() {
|
||||
// Failure
|
||||
bootbox.alert(I18n.t("generic_error"));
|
||||
function(error) {
|
||||
popupAjaxError(error);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
@ -58,7 +58,7 @@ class UserBadgesController < ApplicationController
|
||||
|
||||
if params[:reason].present?
|
||||
unless is_badge_reason_valid? params[:reason]
|
||||
return render json: { failed: I18n.t('invalid_grant_badge_reason_link') }, status: 400
|
||||
return render json: failed_json.merge(message: I18n.t('invalid_grant_badge_reason_link')), status: 400
|
||||
end
|
||||
|
||||
path = begin
|
||||
|
Loading…
Reference in New Issue
Block a user