end
end
- def follow(%{assigns: %{user: user}} = conn, %{ "user_id" => followed_id }) do
- case TwitterAPI.follow(user, followed_id) do
+ def mentions_timeline(%{assigns: %{user: user}} = conn, params) do
+ statuses = TwitterAPI.fetch_mentions(user, params)
+ {:ok, json} = Poison.encode(statuses)
+
+ conn
+ |> json_reply(200, json)
+ end
+
+ def follow(%{assigns: %{user: user}} = conn, params) do
+ case TwitterAPI.follow(user, params) do
{ :ok, user, followed, _activity } ->
response = followed |> UserRepresenter.to_json(%{for: user})
conn