Merge branch 'object-normalize-refactor' into 'develop'
[akkoma] / lib / pleroma / web / mastodon_api / controllers / suggestion_controller.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.MastodonAPI.SuggestionController do
6 use Pleroma.Web, :controller
7
8 require Logger
9
10 plug(Pleroma.Web.ApiSpec.CastAndValidate)
11 plug(Pleroma.Web.Plugs.OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
12
13 def open_api_operation(action) do
14 operation = String.to_existing_atom("#{action}_operation")
15 apply(__MODULE__, operation, [])
16 end
17
18 def index_operation do
19 %OpenApiSpex.Operation{
20 tags: ["Suggestions"],
21 summary: "Follow suggestions (Not implemented)",
22 operationId: "SuggestionController.index",
23 responses: %{
24 200 => Pleroma.Web.ApiSpec.Helpers.empty_array_response()
25 }
26 }
27 end
28
29 @doc "GET /api/v1/suggestions"
30 def index(conn, params),
31 do: Pleroma.Web.MastodonAPI.MastodonAPIController.empty_array(conn, params)
32 end