Update ApiV1Controller, fix followAccountById with firstOrCreate()

This commit is contained in:
Daniel Supernault 2022-11-17 18:59:51 -07:00
parent 59702d406b
commit 1d52ad0b27
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -692,10 +692,10 @@ class ApiV1Controller extends Controller
(new FollowerController())->sendFollow($user->profile, $target);
}
} else {
$follower = new Follower();
$follower->profile_id = $user->profile_id;
$follower->following_id = $target->id;
$follower->save();
$follower = Follower::firstOrCreate([
'profile_id' => $user->profile_id,
'following_id' => $target->id
]);
if($remote == true && config('federation.activitypub.remoteFollow') == true) {
(new FollowerController())->sendFollow($user->profile, $target);