aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-08-21 19:45:58 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-08-27 15:09:06 +0200
commit9bddb39ff097d527ef71860a1d0498dc57f7cd06 (patch)
treecb1bc1678bf61ee73b603313fb3365e355639669
parentd571a571fe969821923ea26c874c7cd77eec5465 (diff)
downloadpleroma-9bddb39ff097d527ef71860a1d0498dc57f7cd06.tar.gz
[Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A
-rw-r--r--lib/pleroma/web/mastodon_api/views/filter_view.ex8
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
}