Fix distance inclusion on reverse search form

This commit is contained in:
byte[] 2021-10-24 16:18:50 -04:00
parent 89ae9a8742
commit 6b2e46c9e8
2 changed files with 3 additions and 2 deletions

View file

@ -10,7 +10,8 @@ defmodule PhilomenaWeb.Search.ReverseController do
create(conn, params) create(conn, params)
end end
def create(conn, %{"image" => image_params}) when is_map(image_params) do def create(conn, %{"image" => image_params})
when is_map(image_params) and image_params != %{} do
images = ImageReverse.images(image_params) images = ImageReverse.images(image_params)
render(conn, "index.html", title: "Reverse Search", images: images) render(conn, "index.html", title: "Reverse Search", images: images)

View file

@ -26,7 +26,7 @@ h1 Reverse Search
.field .field
= label f, :distance, "Match distance (suggested values: between 0.2 and 0.5)" = label f, :distance, "Match distance (suggested values: between 0.2 and 0.5)"
br br
= number_input f, :distance, name: "distance", value: 0.25, min: 0, max: 1, step: 0.01, class: "input" = number_input f, :distance, value: 0.25, min: 0, max: 1, step: 0.01, class: "input"
.field .field
= submit "Reverse Search", class: "button" = submit "Reverse Search", class: "button"