Update ApiV1Dot1Controller, fix Story report follower check

pull/6154/head
Daniel Supernault 2025-09-03 03:09:44 -06:00
rodzic f195102b34
commit ec21eec508
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
use App\AccountLog;
use App\EmailVerification;
use App\Follower;
use App\Http\Controllers\Controller;
use App\Http\Controllers\StatusController;
use App\Http\Resources\StatusStateless;
@ -154,7 +155,7 @@ class ApiV1Dot1Controller extends Controller
if ($object->profile_id == $user->profile_id) {
return $this->error('Cannot self report', 400, ['error_code' => 'ERROR_NO_SELF_REPORTS']);
}
if (! FollowerService::follows($user->profile_id, $object->profile_id)) {
if (! Follower::whereProfileId($user->profile_id)->whereFollowingId($object->profile_id)->exists()) {
return $this->error('Invalid object id', 400, ['error_code' => 'ERROR_INVALID_OBJECT_ID']);
}
$object_type = 'App\Story';