mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update ApiV1Controller, fix blocking remote accounts. Closes #4256
This commit is contained in:
parent
b7501ee46e
commit
8e71e0c03e
1 changed files with 2 additions and 2 deletions
|
@ -1012,7 +1012,7 @@ class ApiV1Controller extends Controller
|
|||
|
||||
$profile = Profile::findOrFail($id);
|
||||
|
||||
if($profile->user->is_admin == true) {
|
||||
if($profile->user && $profile->user->is_admin == true) {
|
||||
abort(400, 'You cannot block an admin');
|
||||
}
|
||||
|
||||
|
@ -1047,7 +1047,7 @@ class ApiV1Controller extends Controller
|
|||
]);
|
||||
|
||||
RelationshipService::refresh($pid, $id);
|
||||
|
||||
UserFilterService::block($pid, $id);
|
||||
$resource = new Fractal\Resource\Item($profile, new RelationshipTransformer());
|
||||
$res = $this->fractal->createData($resource)->toArray();
|
||||
|
||||
|
|
Loading…
Reference in a new issue