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
This commit is contained in:
parent
f5783182c3
commit
28329ba62f
7 changed files with 271 additions and 0 deletions
|
@ -428,6 +428,7 @@ en:
|
|||
destroyed_msg: Domain block has been undone
|
||||
domain: Domain
|
||||
edit: Edit domain block
|
||||
existing_domain_block: You have already imposed stricter limits on %{name}.
|
||||
existing_domain_block_html: You have already imposed stricter limits on %{name}, you need to <a href="%{unblock_url}">unblock it</a> first.
|
||||
new:
|
||||
create: Create block
|
||||
|
|
|
@ -559,6 +559,8 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :domain_blocks, only: [:index, :show, :update, :create, :destroy]
|
||||
|
||||
namespace :trends do
|
||||
resources :tags, only: [:index]
|
||||
resources :links, only: [:index]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue