Revert "feat: D & D による上位タグ設定(#184) (#186)"
This reverts commit 5f306b04b8.
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
class TagChildrenController < ApplicationController
|
||||
def create
|
||||
return head :unauthorized unless current_user
|
||||
return head :forbidden unless current_user.admin?
|
||||
|
||||
parent_id = params[:parent_id]
|
||||
child_id = params[:child_id]
|
||||
return head :bad_request if parent_id.blank? || child_id.blank?
|
||||
|
||||
Tag.find(parent_id).children << Tag.find(child_id) rescue nil
|
||||
|
||||
head :no_content
|
||||
end
|
||||
|
||||
def destroy
|
||||
return head :unauthorized unless current_user
|
||||
return head :forbidden unless current_user.admin?
|
||||
|
||||
parent_id = params[:parent_id]
|
||||
child_id = params[:child_id]
|
||||
return head :bad_request if parent_id.blank? || child_id.blank?
|
||||
|
||||
Tag.find(parent_id).children.delete(Tag.find(child_id)) rescue nil
|
||||
|
||||
head :no_content
|
||||
end
|
||||
end
|
||||
@@ -39,17 +39,6 @@ class TagsController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
return head :unauthorized unless current_user
|
||||
return head :forbidden unless current_user.member?
|
||||
|
||||
tag = Tag.find(params[:id])
|
||||
|
||||
attrs = { name: params[:name].presence,
|
||||
category: params[:category].presence }.compact
|
||||
|
||||
tag.update!(attrs) if attrs.present?
|
||||
|
||||
render json: tag
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
Reference in New Issue
Block a user