clean up
[akkoma] / lib / pleroma / web / mastodon_api / views / filter_view.ex
index 3f8c62f242222f43c42015f505d99470c8c58533..6bd687d46e1a4b88f508ecf90be8d16942b05326 100644 (file)
@@ -8,11 +8,18 @@ defmodule Pleroma.Web.MastodonAPI.FilterView do
   end
 
   def render("filter.json", %{filter: filter}) do
+    expires_at =
+      if filter.expires_at do
+        Utils.to_masto_date(filter.expires_at)
+      else
+        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
     }