Преглед изворни кода

Improve reblog api performance

Daniel Supernault пре 3 година
родитељ
комит
b3ef2b2902
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      app/Http/Controllers/Api/ApiV1Controller.php

+ 2 - 2
app/Http/Controllers/Api/ApiV1Controller.php

@@ -2238,7 +2238,7 @@ class ApiV1Controller extends Controller
 
 
 		if($status->profile_id !== $user->profile_id) {
 		if($status->profile_id !== $user->profile_id) {
 			if($status->scope == 'private') {
 			if($status->scope == 'private') {
-				abort_if(!$status->profile->followedBy($user->profile), 403);
+				abort_if(!FollowerService::follows($user->profile_id, $status->profile_id), 403);
 			} else {
 			} else {
 				abort_if(!in_array($status->scope, ['public','unlisted']), 403);
 				abort_if(!in_array($status->scope, ['public','unlisted']), 403);
 			}
 			}
@@ -2281,7 +2281,7 @@ class ApiV1Controller extends Controller
 
 
 		if($status->profile_id !== $user->profile_id) {
 		if($status->profile_id !== $user->profile_id) {
 			if($status->scope == 'private') {
 			if($status->scope == 'private') {
-				abort_if(!$status->profile->followedBy($user->profile), 403);
+				abort_if(!FollowerService::follows($user->profile_id, $status->profile_id), 403);
 			} else {
 			} else {
 				abort_if(!in_array($status->scope, ['public','unlisted']), 403);
 				abort_if(!in_array($status->scope, ['public','unlisted']), 403);
 			}
 			}