mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-30 09:02:28 +00:00
[Pleroma.Web.MastodonAPI.FilterView]: expires_at should be null when N/A
This commit is contained in:
parent
d571a571fe
commit
9bddb39ff0
|
@ -8,11 +8,17 @@ defmodule Pleroma.Web.MastodonAPI.FilterView do
|
||||||
end
|
end
|
||||||
|
|
||||||
def render("filter.json", %{filter: filter}) do
|
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),
|
id: to_string(filter.filter_id),
|
||||||
phrase: filter.phrase,
|
phrase: filter.phrase,
|
||||||
context: filter.context,
|
context: filter.context,
|
||||||
expires_at: Utils.to_masto_date(filter.expires_at),
|
expires_at: expires_at,
|
||||||
irreversible: filter.hide,
|
irreversible: filter.hide,
|
||||||
whole_word: false
|
whole_word: false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue