docbrown/app/controllers/api/v0/follows_controller.rb
Andy Zhao a1010201f2 Notifications part 2 (#1156)
* Remove stream and add new notification views

* Actually remove Stream

* Move followers query to async method

* Remove unused tests and fix query

* Try using without delay instead

* Add without delay and escape HTML

* Make all tests pending for now
2018-11-19 18:14:24 -05:00

16 lines
440 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)
# Notification.send_new_follow
end
render json: { outcome: "followed 50 users" }
end
end
end
end