mock /api/v1/suggestions
authorhakabahitoyo <hakabahitoyo@example.com>
Fri, 13 Jul 2018 15:44:18 +0000 (00:44 +0900)
committerhakabahitoyo <hakabahitoyo@example.com>
Fri, 13 Jul 2018 15:44:18 +0000 (00:44 +0900)
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

index 0184d52c8fdd4bbdccb5d7d8257789631bc0cfed..0f50eba848f030b171cfc54975db19c877ece81c 100644 (file)
@@ -1071,8 +1071,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
     |> json("Something went wrong")
   end
 
-  def suggestions(conn, _) do
+  def suggestions(%{assigns: %{user: user}} = conn, _) do
+    res = %{
+      host: (String.replace Web.base_url(), "https://", ""),
+      user: user.nickname
+    }
     conn
-    |> json("SUGGESTIONS!")
+    |> json(res)
   end
 end