Better handle datetime

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-14 19:29:18 +02:00
parent cc701f8994
commit d93561742a
17 changed files with 168 additions and 48 deletions

View File

@@ -138,7 +138,7 @@ defmodule Mobilizon.Service.ActivityPub.Converter.Event do
|> Enum.map(&Utils.camelize/1)
Enum.reduce(object, %{}, fn {key, value}, acc ->
(value && key in keys && Map.put(acc, Utils.underscore(key), value)) ||
(!is_nil(value) && key in keys && Map.put(acc, Utils.underscore(key), value)) ||
acc
end)
end

View File

@@ -346,7 +346,7 @@ defmodule Mobilizon.Service.ActivityPub.Utils do
options = Events.EventOptions |> struct(metadata.options) |> Map.from_struct()
Enum.reduce(options, res, fn {key, value}, acc ->
(value && Map.put(acc, camelize(key), value)) ||
(!is_nil(value) && Map.put(acc, camelize(key), value)) ||
acc
end)
end