From: Haelwenn (lanodan) Monnier Date: Tue, 21 Aug 2018 17:45:58 +0000 (+0200) Subject: [Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9bddb39ff097d527ef71860a1d0498dc57f7cd06;p=akkoma [Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A --- 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 }