This commit is contained in:
2026-04-22 23:32:05 +09:00
parent 6b0d262040
commit 3da9b447d4
6 changed files with 103 additions and 35 deletions
+10 -4
View File
@@ -220,8 +220,14 @@ class TagsController < ApplicationController
category = params[:category].to_s.strip
return head :unprocessable_entity if name.blank? || category.blank?
if tag.nico? != (category == 'nico')
return render json: { error: 'ニコタグのカテゴリ変更はできません.' },
if name != tag.name &&
tag.in?([Tag.tagme, Tag.bot, Tag.no_deerjikist, Tag.video, Tag.niconico])
return render json: { error: 'システム・タグの名称は変更できません.' },
status: :unprocessable_entity
end
if tag.nico? || category == 'nico'
return render json: { error: 'ニコタグは変更できません.' },
status: :unprocessable_entity
end
@@ -258,8 +264,8 @@ class TagsController < ApplicationController
tag = Tag.find(params[:id])
if category.present? && tag.nico? != (category == 'nico')
return render json: { error: 'ニコタグのカテゴリ変更できません.' },
if tag.nico? || (category.present? && category == 'nico')
return render json: { error: 'ニコタグ変更できません.' },
status: :unprocessable_entity
end