Skip to content

Commit

Permalink
Search tag by id or name (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljesusg committed Feb 14, 2018
1 parent 1018d56 commit 0ffe818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/v1/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ def index
def show
return unless check_params_required(:id)
logger.debug 'Returning tag @tag.name'
@tag = Tag.find_by(name: params[:id])
@tag = Tag.find_by(name: params[:id]) || Tag.find_by(id: params[:id])
if @tag
return_response @tag, :ok, {}
else
render_error_exchange(:tag_not_found, :not_found, { tag_id: parans[:id]})
render_error_exchange(:tag_not_found, :not_found, { tag_id: params[:id]})
end
end
end
Expand Down

0 comments on commit 0ffe818

Please sign in to comment.