This commit is contained in:
@@ -39,6 +39,17 @@ 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