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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

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

View File

@ -8,7 +8,7 @@ acceptance("Admin - Suspend User", {
server.put("/admin/users/:user_id/suspend", () =>
helper.response(200, {
suspension: {
suspended: true
suspended_till: "2099-01-01T12:00:00.000Z"
}
})
);
@ -16,7 +16,7 @@ acceptance("Admin - Suspend User", {
server.put("/admin/users/:user_id/unsuspend", () =>
helper.response(200, {
suspension: {
suspended: false
suspended_till: null
}
})
);