From 23c4f4949436003f6ccd7fd283492a6598f88482 Mon Sep 17 00:00:00 2001 From: Sadposter Date: Fri, 5 Apr 2019 14:27:26 +0100 Subject: [PATCH] Fix subscription endpoint return formats --- lib/pleroma/web/twitter_api/twitter_api.ex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 7720367ad..5537680ad 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -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 -- 2.45.2