Fix error when last sync is present but is invalid datetime
This commit is contained in:
parent
0e90ee527c
commit
3129142274
|
@ -135,10 +135,12 @@ defmodule FrenzyWeb.Fervor.ItemsController do
|
|||
|> Repo.all()
|
||||
|
||||
last_sync =
|
||||
Map.get(params, "last_sync")
|
||||
|> case do
|
||||
s when is_binary(s) -> Timex.parse!(s, "{ISO:Extended:Z}")
|
||||
_ -> nil
|
||||
with s when is_binary(s) <- Map.get(params, "last_sync"),
|
||||
{:ok, datetime} <- Timex.parse(s) do
|
||||
datetime
|
||||
else
|
||||
_ ->
|
||||
nil
|
||||
end
|
||||
|
||||
{deleted_ids, upserted} =
|
||||
|
|
Loading…
Reference in New Issue