Fix /api/v1/admin/accounts (#17887)

* Fix /api/v1/admin/accounts

Compatibility was broken since #17009 which changed the underlying filter class
without changing the controller.

This commits restore support for the old parameters.

* Add /api/v2/admin/accounts with the new parameters

* Add tests

* Add missing filter for `silenced` status

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
Claire 2022-03-28 23:57:38 +02:00 committed by GitHub
parent 22eeaf2645
commit 894956e20c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 159 additions and 4 deletions

View file

@ -80,6 +80,10 @@ class AccountFilter
accounts_with_users.merge(User.pending)
when 'suspended'
Account.suspended
when 'disabled'
accounts_with_users.merge(User.disabled)
when 'silenced'
Account.silenced
else
raise "Unknown status: #{value}"
end