From 28329ba62f90890b110517f6da69ca81d588f2f5 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 1 Jun 2022 17:31:36 +0200 Subject: 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 --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index b05d31e4e..dfce94929 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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] -- cgit