[Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-08-21 19:45:58 +02:00
parent d571a571fe
commit 9bddb39ff0
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 7 additions and 1 deletions

View File

@ -8,11 +8,17 @@ def render("filters.json", %{filters: filters} = opts) do
end
def render("filter.json", %{filter: filter}) do
if filter.expires_at do
expires_at = Utils.to_masto_date(filter.expires_at)
else
expires_at = nil
end
%{
id: to_string(filter.filter_id),
phrase: filter.phrase,
context: filter.context,
expires_at: Utils.to_masto_date(filter.expires_at),
expires_at: expires_at,
irreversible: filter.hide,
whole_word: false
}