Skip to content

Commit

Permalink
fix: load event mentioned tags on show discussion endpoint (#3915)
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 authored Nov 1, 2023
1 parent a3192d2 commit 5cdfa0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extensions/tags/extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,14 @@
(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),
];

0 comments on commit 5cdfa0f

Please sign in to comment.