projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into seanking/pleroma...
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
controllers
/
filter_controller.ex
diff --git
a/lib/pleroma/web/mastodon_api/controllers/filter_controller.ex
b/lib/pleroma/web/mastodon_api/controllers/filter_controller.ex
index dd13a8a0956f08ac00d3b74d3b4e0f3de6fe93b3..abbf0ce02e9c0f50085f682ecca6e4e19f231e79 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/controllers/filter_controller.ex
+++ b/
lib/pleroma/web/mastodon_api/controllers/filter_controller.ex
@@
-17,7
+17,7
@@
defmodule Pleroma.Web.MastodonAPI.FilterController do
OAuthScopesPlug,
%{scopes: ["write:filters"]} when action not in @oauth_read_actions
)
OAuthScopesPlug,
%{scopes: ["write:filters"]} when action not in @oauth_read_actions
)
-
+
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.FilterOperation
@doc "GET /api/v1/filters"
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.FilterOperation
@doc "GET /api/v1/filters"
@@
-35,7
+35,7
@@
defmodule Pleroma.Web.MastodonAPI.FilterController do
context: params.context,
hide: params.irreversible,
whole_word: params.whole_word
context: params.context,
hide: params.irreversible,
whole_word: params.whole_word
- #
expires_at
+ #
TODO: support `expires_in` parameter (as in Mastodon API)
}
{:ok, response} = Filter.create(query)
}
{:ok, response} = Filter.create(query)
@@
-57,13
+57,12
@@
defmodule Pleroma.Web.MastodonAPI.FilterController do
) do
params =
params
) do
params =
params
- |> Map.from_struct()
|> Map.delete(:irreversible)
|> Map.delete(:irreversible)
- |> Map.put(:hide, params
.irreversible
)
+ |> Map.put(:hide, params
[:irreversible]
)
|> Enum.reject(fn {_key, value} -> is_nil(value) end)
|> Map.new()
|> Enum.reject(fn {_key, value} -> is_nil(value) end)
|> Map.new()
- # TODO:
add expires_in -> expires_at
+ # TODO:
support `expires_in` parameter (as in Mastodon API)
with %Filter{} = filter <- Filter.get(filter_id, user),
{:ok, %Filter{} = filter} <- Filter.update(filter, params) do
with %Filter{} = filter <- Filter.get(filter_id, user),
{:ok, %Filter{} = filter} <- Filter.update(filter, params) do