From feefc2e5a7ae3c80c0a9c2e2c7c858b65df432f6 Mon Sep 17 00:00:00 2001 From: SomewhatDamaged Date: Tue, 14 Jan 2020 22:54:15 +1100 Subject: [PATCH] Fix to allow users to include deleted images again (#22) This used to be allowed in the old searching with the `deleted` param for all users. This should correctly add back the ability (using the new `del` param) to specify `del=1` for any user/API search, but correctly block them from doing the more specialized "staff only" searching. --- lib/philomena_web/image_loader.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/philomena_web/image_loader.ex b/lib/philomena_web/image_loader.ex index ece6717c..0f211dc8 100644 --- a/lib/philomena_web/image_loader.ex +++ b/lib/philomena_web/image_loader.ex @@ -67,13 +67,13 @@ defmodule PhilomenaWeb.ImageLoader do end # Allow moderators to index hidden images + + defp maybe_show_deleted(filters, _show_hidden?, "1"), + do: filters defp maybe_show_deleted(filters, false, _param), do: [%{term: %{hidden_from_users: true}} | filters] - defp maybe_show_deleted(filters, true, "1"), - do: filters - defp maybe_show_deleted(filters, true, "only"), do: [%{term: %{hidden_from_users: false}} | filters]