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:
parent
80d8830c17
commit
f6ea986aec
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue