Fix subscription endpoint return formats
authorSadposter <hannah+pleroma@coffee-and-dreams.uk>
Fri, 5 Apr 2019 13:27:26 +0000 (14:27 +0100)
committerHannah Ward <Hannah.ward9001@gmail.com>
Fri, 5 Apr 2019 14:30:24 +0000 (15:30 +0100)
lib/pleroma/web/twitter_api/twitter_api.ex

index 7720367adb5097a2b7366d50cec01207ff331f53..5537680ad0bc031f388a71e7dae2ca2987a9cb92 100644 (file)
@@ -60,15 +60,16 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
   end
 
   def subscribe(%User{} = subscriber, params) do
-    with {:ok, %User{} = subscribed} <- get_user(params) do
-      User.subscribe(subscriber, subscribed)
-      |> IO.inspect
+    with {:ok, %User{} = subscribed} <- get_user(params),
+         {:ok, subscriber} <- User.subscribe(subscriber, subscribed) do
+      {:ok, subscriber, subscribed}
     end
   end
 
   def unsubscribe(%User{} = unsubscriber, params) do
-    with {:ok, %User{} = unsubscribed} <- get_user(params) do
-      User.unsubscribe(unsubscriber, unsubscribed)
+    with {:ok, %User{} = unsubscribed} <- get_user(params),
+         {:ok, unsubscriber} <- User.unsubscribe(unsubscriber, unsubscribed) do
+      {:ok, unsubscriber, unsubscribed}
     end
   end