Merge pull request #4262 from pixelfed/staging

Update ApiV1Controller, fix blocking remote accounts. Closes #4256
This commit is contained in:
daniel 2023-03-28 20:23:28 -06:00 committed by GitHub
commit 4d9189e87c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -1,6 +1,9 @@
# Release Notes # Release Notes
## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.5...dev) ## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.5...dev)
### Updates
- Update ApiV1Controller, fix blocking remote accounts. Closes #4256 ([8e71e0c0](https://github.com/pixelfed/pixelfed/commit/8e71e0c0))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.5 (2023-03-25)](https://github.com/pixelfed/pixelfed/compare/v0.11.4...v0.11.5) ## [v0.11.5 (2023-03-25)](https://github.com/pixelfed/pixelfed/compare/v0.11.4...v0.11.5)

View file

@ -1012,7 +1012,7 @@ class ApiV1Controller extends Controller
$profile = Profile::findOrFail($id); $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'); abort(400, 'You cannot block an admin');
} }
@ -1047,7 +1047,7 @@ class ApiV1Controller extends Controller
]); ]);
RelationshipService::refresh($pid, $id); RelationshipService::refresh($pid, $id);
UserFilterService::block($pid, $id);
$resource = new Fractal\Resource\Item($profile, new RelationshipTransformer()); $resource = new Fractal\Resource\Item($profile, new RelationshipTransformer());
$res = $this->fractal->createData($resource)->toArray(); $res = $this->fractal->createData($resource)->toArray();