feat: 類似度算出バッチ修正,ほか(#228) (#232)
#228 #228 #228 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #232
This commit was merged in pull request #232.
This commit is contained in:
@@ -49,13 +49,19 @@ class TagsController < ApplicationController
|
||||
return head :unauthorized unless current_user
|
||||
return head :forbidden unless current_user.member?
|
||||
|
||||
name = params[:name].presence
|
||||
category = params[:category].presence
|
||||
|
||||
tag = Tag.find(params[:id])
|
||||
|
||||
attrs = { name: params[:name].presence,
|
||||
category: params[:category].presence }.compact
|
||||
if name.present?
|
||||
tag.tag_name.update!(name:)
|
||||
end
|
||||
|
||||
tag.update!(attrs) if attrs.present?
|
||||
if category.present?
|
||||
tag.update!(category:)
|
||||
end
|
||||
|
||||
render json: tag
|
||||
render json: tag.as_json(methods: [:name])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user