fix: prevent sending group physical address if it's empty and allow empty text for timezone
As old addresses don't hold TZ information Closes #1357 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -17,6 +17,8 @@ defmodule Mobilizon.GraphQL.Schema.Custom.Timezone do
|
||||
|
||||
@spec decode(Absinthe.Blueprint.Input.String.t()) :: {:ok, term} | :error
|
||||
@spec decode(Absinthe.Blueprint.Input.Null.t()) :: {:ok, nil}
|
||||
defp decode(%Absinthe.Blueprint.Input.String{value: ""}), do: {:ok, nil}
|
||||
|
||||
defp decode(%Absinthe.Blueprint.Input.String{value: value}) do
|
||||
if Tzdata.zone_exists?(value),
|
||||
do: {:ok, value},
|
||||
|
||||
Reference in New Issue
Block a user