Commit graph

16 commits

Author SHA1 Message Date
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
3e27e9c986
Added user badge_ids to the api (#20365) 2023-11-17 17:01:55 +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
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03: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
Fernando Valverde
5caca502d3
ActiveSupport::Notifications listen/forget fix (#18549)
* active support notifications debug

* Match missing .forget listeners
2022-10-07 11:00:37 -06: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
Fernando Valverde
808149a424
Remove api_v1 feature flag (#18213) 2022-08-23 16:00:08 -04:00
Fernando Valverde
2ad02cf31c
API v1 without api key restriction (#18340)
* Remove :api_v1 feature flag

* Reworking the auth configs throughout V1 + specs

* Fix remaining v1 specs

* Enhanced inline docs

* deprecation warning update

* Use headers variable for most v1 specs

* Cherry pick spec changes

* Fix specs

* group let! statements - rubocop

* Bring back ||= on api v1 authentication methods

* Bump swagger/v1/api_v1.json
2022-08-19 14:04:41 -06: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