From 9bddb39ff097d527ef71860a1d0498dc57f7cd06 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 21 Aug 2018 19:45:58 +0200 Subject: [PATCH] [Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A --- lib/pleroma/web/mastodon_api/views/filter_view.ex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 } -- 2.45.2