Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Find using int of fingerpint
  • Loading branch information
mjy committed Oct 2, 2024
1 parent 71c6ddb commit 6c69373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def api_index

# GET /api/v1/images/:id
def api_show
@image = Image.where(project_id: sessions_current_project_id).find_by(id: params[:id])
@image = Image.where(project_id: sessions_current_project_id).find_by(id: params.permit(id: :integer)[:id])
@image ||= Image.where(project_id: sessions_current_project_id).find_by(image_file_fingerprint: params[:id])

render plain: 'Not found. You may need to add a &project_token= param to the URL currently in your address bar to access these data. See https://api.taxonworks.org/ for more.', status: :not_found and return if @image.nil?
Expand Down

0 comments on commit 6c69373

Please sign in to comment.