Update FollowerController

This commit is contained in:
Daniel Supernault 2019-08-12 02:47:20 -06:00
parent 38a0fd30fe
commit dccaa2bd94
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -89,8 +89,12 @@ class FollowerController extends Controller
}
FollowPipeline::dispatch($follower);
} else {
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail();
if($remote == true) {
$request = FollowRequest::whereFollowerId($user->id)->whereFollowingId($target->id)->exists();
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->exists();
if($remote == true && $request && !$follower) {
$this->sendFollow($user, $target);
}
if($remote == true && $follower) {
$this->sendUndoFollow($user, $target);
}
$follower->delete();