projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/support-bot-field-in-update-credentials' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
controllers
/
marker_controller.ex
diff --git
a/lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
b/lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
index b94171b365d429a07d582ee4006361cc4713dc63..85310edfa7c938d84d371cf0d2409aa300d42520 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
+++ b/
lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
@@
-6,6
+6,8
@@
defmodule Pleroma.Web.MastodonAPI.MarkerController do
use Pleroma.Web, :controller
alias Pleroma.Plugs.OAuthScopesPlug
use Pleroma.Web, :controller
alias Pleroma.Plugs.OAuthScopesPlug
+ plug(Pleroma.Web.ApiSpec.CastAndValidate)
+
plug(
OAuthScopesPlug,
%{scopes: ["read:statuses"]}
plug(
OAuthScopesPlug,
%{scopes: ["read:statuses"]}
@@
-15,7
+17,6
@@
defmodule Pleroma.Web.MastodonAPI.MarkerController do
plug(OAuthScopesPlug, %{scopes: ["write:statuses"]} when action == :upsert)
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
plug(OAuthScopesPlug, %{scopes: ["write:statuses"]} when action == :upsert)
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
- plug(OpenApiSpex.Plug.CastAndValidate)
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.MarkerOperation
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.MarkerOperation
@@
-27,10
+28,7
@@
defmodule Pleroma.Web.MastodonAPI.MarkerController do
# POST /api/v1/markers
def upsert(%{assigns: %{user: user}, body_params: params} = conn, _) do
# POST /api/v1/markers
def upsert(%{assigns: %{user: user}, body_params: params} = conn, _) do
- params =
- params
- |> Map.from_struct()
- |> Map.new(fn {key, value} -> {to_string(key), value} end)
+ params = Map.new(params, fn {key, value} -> {to_string(key), value} end)
with {:ok, result} <- Pleroma.Marker.upsert(user, params),
markers <- Map.values(result) do
with {:ok, result} <- Pleroma.Marker.upsert(user, params),
markers <- Map.values(result) do