mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
18 lines
390 B
Elixir
18 lines
390 B
Elixir
defmodule Philomena.ImageScope do
|
|
def scope(conn) do
|
|
[]
|
|
|> scope(conn, "q", :q)
|
|
|> scope(conn, "sf", :sf)
|
|
|> scope(conn, "sd", :sd)
|
|
|> scope(conn, "del", :del)
|
|
|> scope(conn, "hidden", :hidden)
|
|
end
|
|
|
|
defp scope(list, conn, key, key_atom) do
|
|
case conn.params[key] do
|
|
nil -> list
|
|
"" -> list
|
|
val -> [{key_atom, val} | list]
|
|
end
|
|
end
|
|
end
|