Add missing deleted filter on featured lookup (fixes philomena-dev/philomena#124)

This commit is contained in:
byte[] 2021-07-15 20:02:54 -04:00
parent ac6dde20ef
commit 38c134668a
2 changed files with 2 additions and 0 deletions

View file

@ -73,6 +73,7 @@ defmodule PhilomenaWeb.ActivityController do
featured_image =
Image
|> join(:inner, [i], f in ImageFeature, on: [image_id: i.id])
|> where([i], i.hidden_from_users == false)
|> filter_hidden(user, conn.params["hidden"])
|> order_by([i, f], desc: f.created_at)
|> limit(1)

View file

@ -13,6 +13,7 @@ defmodule PhilomenaWeb.Api.Json.Image.FeaturedController do
featured_image =
Image
|> join(:inner, [i], f in ImageFeature, on: [image_id: i.id])
|> where([i], i.hidden_from_users == false)
|> order_by([_i, f], desc: f.created_at)
|> limit(1)
|> preload([:user, :intensity, tags: :aliases])