Skip to content

Commit

Permalink
fix: load event mentioned tags on show discussion endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Oct 29, 2023
1 parent 2950290 commit 33d5662
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 33d5662

Please sign in to comment.