diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-08-21 19:45:58 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-08-27 15:09:06 +0200 |
commit | 9bddb39ff097d527ef71860a1d0498dc57f7cd06 (patch) | |
tree | cb1bc1678bf61ee73b603313fb3365e355639669 /lib | |
parent | d571a571fe969821923ea26c874c7cd77eec5465 (diff) | |
download | pleroma-9bddb39ff097d527ef71860a1d0498dc57f7cd06.tar.gz |
[Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/filter_view.ex | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/filter_view.ex b/lib/pleroma/web/mastodon_api/views/filter_view.ex index 3f8c62f24..e8401cc2d 100644 --- a/lib/pleroma/web/mastodon_api/views/filter_view.ex +++ b/lib/pleroma/web/mastodon_api/views/filter_view.ex @@ -8,11 +8,17 @@ defmodule Pleroma.Web.MastodonAPI.FilterView 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 } |