fix gallery ordering bug...

This commit is contained in:
byte[] 2020-03-29 23:52:53 -04:00
parent 2dc36ee36e
commit 7ace92c651

View file

@ -224,7 +224,7 @@ defmodule Philomena.Galleries do
spawn(fn ->
interactions =
Interaction
|> where([gi], gi.image_id in ^image_ids)
|> where([gi], gi.image_id in ^image_ids and gi.gallery_id == ^gallery.id)
|> order_by(^position_order(gallery))
|> Repo.all()
@ -261,15 +261,6 @@ defmodule Philomena.Galleries do
end
end)
IO.inspect([
image_ids: image_ids,
interactions: interactions,
interaction_positions: interaction_positions,
images_present: images_present,
requested: requested,
changes: changes
], limit: :infinity)
changes
|> Enum.map(fn change ->
id = Keyword.fetch!(change, :id)