mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 04:47:08 +08:00
fix: load event mentioned tags on show discussion endpoint (#3915)
This commit is contained in:
parent
a3192d2934
commit
5cdfa0f640
@ -177,10 +177,14 @@ return [
|
||||
(new Extend\ApiController(FlarumController\ListPostsController::class))
|
||||
->addInclude('eventPostMentionsTags')
|
||||
// Restricted tags should still appear as `deleted` to unauthorized users.
|
||||
->loadWhere('eventPostMentionsTags', function (Relation|Builder $query, ?ServerRequestInterface $request) {
|
||||
->loadWhere('eventPostMentionsTags', $restrictMentionedTags = function (Relation|Builder $query, ?ServerRequestInterface $request) {
|
||||
if ($request) {
|
||||
$actor = RequestUtil::getActor($request);
|
||||
$query->whereVisibleTo($actor);
|
||||
}
|
||||
}),
|
||||
|
||||
(new Extend\ApiController(FlarumController\ShowDiscussionController::class))
|
||||
->addInclude('posts.eventPostMentionsTags')
|
||||
->loadWhere('posts.eventPostMentionsTags', $restrictMentionedTags),
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user