Commit graph

12 commits

Author SHA1 Message Date
Anna Buianova
4815661bad
Api search users by email (#20423) 2023-12-04 23:18:36 +00:00
Anna Buianova
df0b134ec4
Added followers count to /api/users/me endpoint (#20378)
* Added followers_count to /api/users/me

* Updated the api user docs

* Rubocop fixes fro swagger_helper

* Added me jbuilder view for api/v0
2023-11-22 20:22:06 +00:00
Anna Buianova
5ac786c9a1
Add email to the users api (#20241)
* Add email to the users api if display_public_email_on_profile is set to true

* Fixed selected user fields in the api

* A separate partial for user data with email (for the api)
2023-10-13 16:27:21 +03:00
Joshua Wehner
2c138d86ef
Add or remove limited role via API (#20136)
* Refactor API user suspend, make room for more roles

* Handle adding limited

* Handle remove limited

* And swagger docs

* Update & refactor roles spec

* Remove old route

* Remove old specs
2023-09-26 09:57:14 -04:00
Anna Buianova
184ee8039f
Create a note when a users' articles are being unpublished via API (#18545)
* Moved a comment about soft delete from controller to the service

* Create a note when unpublishing all users' articles via api

* Create a note with the default text when unpublishing all via api, added docs
2022-10-10 16:25:56 +03:00
Anna Buianova
9d755a9d2f
Save list of previously-published articles when user is subject to an "un-publish all" action (#18535)
* Moved logging and deleting comments to Moderator::UnpublishAllArticlesWorker

* Added logging for admin action (unpublish_all_articles)

* Extracted code from UnpublishAllArticlesWorker to the service

* Make it possible to add a note while unpublishing all via admin action

* Added ability to add notes for unpublishing all from moderator action panel

* Fixed setting slug for the AuditLog on unpublishing + spec
2022-10-06 14:17:20 +03:00
Josh Puetz
74e44aeb61
Documentation for Negative Behavior APIs (#18187)
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-28 14:30:32 -05:00
Fernando Valverde
c93062b3cf
Add missing action of comment deletion in unpublish API endpoint (#18202)
* Add missing action of comment deletion in unpublish api

* reorganize controller action + inline comments

* Improve spec to check for AuditLog integrity
2022-07-27 09:18:18 -06:00
Fernando Valverde
f77b5f83a9
Include audit log for API admin endpoints (#18167)
* First commit for audit log - specs need fixing

* Fix notification subscription issues + specs

* Use single line in notification subscribe initializer

* Remove conditional in unpublish endpoint
2022-07-22 11:35:30 -06:00
Fernando Valverde
c6c39813a1
New suspend user API endpoint (#18043)
* New suspend user API endpoint

* Restrict admin access only to suspend action

* Add suspended? check on new endpoint spec

* Replace POST with PUT action

* Replace redundant response payload with empty 200 response

* Rely on user_policy instead of before_action method

* Use alias with matching method name instead of unpublish

* Use already existing toggle_suspension_status? method in policy

* Remove manual creation of note

* Update suspend success spec
2022-07-15 09:07:57 -06:00
Fernando Valverde
5df1855103
Unpublish comments+articles by user id in API v1 (#18058)
* unpublish comments+articles by user id in API v1

* Update spec/requests/api/v1/users_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Rely on user_policy instead of before_action method

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-14 11:47:44 -06:00
Fernando Valverde
8c836430ca
API V1 transition (#17835)
* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-06-23 14:26:00 -06:00