]> cat aescling's git repositories - mastodon.git/commit
Add /api/v1/admin/domain_blocks (#18247)
authorClaire <claire.github-309c@sitedethib.com>
Wed, 1 Jun 2022 15:31:36 +0000 (17:31 +0200)
committeraescling <aescling+gitlab@cat.family>
Sun, 28 Aug 2022 21:14:10 +0000 (17:14 -0400)
commit1890479a7e75af342af1fa04dfe734848e67c488
treef35c799df34386f0f445cb3f2257567cdeef739c
parent15b7fba7920e97cb816a8aa2158e4f048d0c6eac
Add /api/v1/admin/domain_blocks (#18247)

* Add /api/v1/admin/domain_blocks

Fixes #18140

- `GET /api/v1/admin/domain_blocks` lists domain blocks
- `GET /api/v1/admin/domain_blocks/:id` shows one by ID
- `DELETE /api/v1/admin/domain_blocks/:id` deletes a given domain block
- `POST /api/v1/admin/domain_blocks` to create a new domain block:
  if it conflicts with an existing one, returns an error with
  an attribute `existing_domain_block` with the rendered domain block

* Simplify conflict handling as suggested in review
app/controllers/api/v1/admin/domain_blocks_controller.rb [new file with mode: 0644]
app/models/domain_block.rb
app/serializers/rest/admin/domain_block_serializer.rb [new file with mode: 0644]
app/serializers/rest/admin/existing_domain_block_error_serializer.rb [new file with mode: 0644]
config/locales/en.yml
config/routes.rb
spec/controllers/api/v1/admin/domain_blocks_controller_spec.rb [new file with mode: 0644]