Browse Source

Fix user representation after following.

tags/v0.9.9
Roger Braun 7 years ago
parent
commit
15655d992e
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      lib/pleroma/web/twitter_api/twitter_api_controller.ex
  2. +2
    -2
      test/web/twitter_api/twitter_api_controller_test.exs

+ 1
- 1
lib/pleroma/web/twitter_api/twitter_api_controller.ex View File

@@ -44,7 +44,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
end

def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do
{ :ok, _user, follower, _activity } = TwitterAPI.follow(user, followed_id)
{ :ok, user, follower, _activity } = TwitterAPI.follow(user, followed_id)

response = follower |> UserRepresenter.to_json(%{for: user})



+ 2
- 2
test/web/twitter_api/twitter_api_controller_test.exs View File

@@ -127,7 +127,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do

current_user = Repo.get(User, current_user.id)
assert current_user.following == [User.ap_followers(followed)]
assert json_response(conn, 200) == UserRepresenter.to_map(followed)
assert json_response(conn, 200) == UserRepresenter.to_map(followed, %{for: current_user})
end
end

@@ -150,7 +150,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do

current_user = Repo.get(User, current_user.id)
assert current_user.following == []
assert json_response(conn, 200) == UserRepresenter.to_map(followed)
assert json_response(conn, 200) == UserRepresenter.to_map(followed, %{for: current_user})
end
end



Loading…
Cancel
Save