X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fcontrollers%2Fmarker_controller.ex;h=c745f34931e82c0a8a167e7b33ee4142fc05139d;hb=33f063204edb63344628bdfa72ff11f81ded62a9;hp=b94171b365d429a07d582ee4006361cc4713dc63;hpb=8096565653f262844214d715228c31d4ef761f57;p=akkoma
diff --git a/lib/pleroma/web/mastodon_api/controllers/marker_controller.ex b/lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
index b94171b36..c745f3493 100644
--- a/lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/marker_controller.ex
@@ -1,10 +1,12 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.MarkerController do
use Pleroma.Web, :controller
- alias Pleroma.Plugs.OAuthScopesPlug
+ alias Pleroma.Web.Plugs.OAuthScopesPlug
+
+ plug(Pleroma.Web.ApiSpec.CastAndValidate)
plug(
OAuthScopesPlug,
@@ -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(OpenApiSpex.Plug.CastAndValidate)
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
- 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