docbrown/app/controllers/api/v0/follows_controller.rb
Ben Halpern 8a1f9991f1
Add users to signup modal (and other adjustments) (#124)
* Add a missing bounty hunter

* Add a msg about updating social usernames

* Add mailto: link for yo@dev in terms

* Use render partial for help tag

* Lint a file

* Add first draft of onboarding follow users

* WIP onboarding

* Change users api controller

* Create FollowSuggester to return suggested follows for user

* Create initial follow users flow in onboarding

* Move follow user logic to top lvl

* Add follow api end point for onboarding

* Add profile img and update follow action

* Remove checkbox and use a tag instead

* Lint and update tests

* Remove incomplete test for now

* Final adjustments to signup modal

* Update jest snapshot

* Add more jest tests and fix typo
2018-03-22 18:29:22 -04:00

15 lines
No EOL
398 B
Ruby

module Api
module V0
class FollowsController < ApplicationController
def create
return unless user_signed_in?
users = JSON.parse(params[:users])
users.each do |user_hash|
followable = User.find(user_hash['id'])
current_user.delay.follow(followable)
end
render json: { outcome: "followed 50 users" }
end
end
end
end