Compare commits

..

No commits in common. "52c6f1ff6c4d26eeae9c4c5b0312912185c14665" and "0e90ee527cbff779d99a51e4b9773b5a29f13b98" have entirely different histories.

1 changed files with 5 additions and 13 deletions

View File

@ -135,24 +135,16 @@ defmodule FrenzyWeb.Fervor.ItemsController do
|> Repo.all()
last_sync =
with s when is_binary(s) <- Map.get(params, "last_sync"),
{:ok, datetime} <- Timex.parse(s) do
datetime
else
_ ->
nil
Map.get(params, "last_sync")
|> case do
s when is_binary(s) -> Timex.parse!(s, "{ISO:Extended:Z}")
_ -> nil
end
{deleted_ids, upserted} =
case last_sync do
nil ->
items =
Item
|> where([i], not i.tombstone and i.feed_id in ^feed_ids)
|> order_by([i], desc: i.inserted_at)
|> limit(1000)
|> Repo.all()
items = Repo.all(from i in Item, where: not i.tombstone and i.feed_id in ^feed_ids)
{[], items}
_ ->