DEV: Remove suspend from Admin::UsersController responses (#8206)

`suspend` isn't a User attribute, but was being assigned to the frontend User model as if it was. The model has a computed property that depends on `suspended_till`, so instead of overriding this property, it's better to return relevant attributes.

Fixes a computed-property.override deprecation (https://emberjs.com/deprecations/v3.x#toc_computed-property-override)
This commit is contained in:
Jarek Radosz
2019-10-18 01:49:26 +02:00
committed by GitHub
parent 80d8830c17
commit f6ea986aec
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -137,7 +137,6 @@ class Admin::UsersController < Admin::AdminController
render_json_dump(
suspension: {
suspended: true,
suspend_reason: params[:reason],
full_suspend_reason: user_history.try(:details),
suspended_till: @user.suspended_till,
@@ -157,7 +156,8 @@ class Admin::UsersController < Admin::AdminController
render_json_dump(
suspension: {
suspended: false
suspended_till: nil,
suspended_at: nil
}
)
end