Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Oct 18, 2023
1 parent 069cdda commit 6e32a7f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 42 deletions.
21 changes: 20 additions & 1 deletion extensions/mentions/extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Flarum\Post\Event\Revised;
use Flarum\Post\Filter\PostFilterer;
use Flarum\Post\Post;
use Flarum\Tags\Api\Serializer\TagSerializer;
use Flarum\User\User;

return [
Expand Down Expand Up @@ -124,5 +125,23 @@

// Tag mentions
(new Extend\Conditional())
->whenExtensionEnabled('flarum-tags', TagExtender::class),
->whenExtensionEnabled('flarum-tags', fn () => [
(new Extend\Formatter)
->render(Formatter\FormatTagMentions::class)
->unparse(Formatter\UnparseTagMentions::class),

(new Extend\ApiSerializer(BasicPostSerializer::class))
->hasMany('mentionsTags', TagSerializer::class),

(new Extend\ApiController(Controller\ShowDiscussionController::class))
->load(['posts.mentionsTags']),

(new Extend\ApiController(Controller\ListDiscussionsController::class))
->load([
'firstPost.mentionsTags', 'lastPost.mentionsTags',
]),

(new Extend\ApiController(Controller\ListPostsController::class))
->load(['mentionsTags']),
]),
];
41 changes: 0 additions & 41 deletions extensions/mentions/src/TagExtender.php

This file was deleted.

0 comments on commit 6e32a7f

Please sign in to comment.