Skip to content

Commit f34de46

Browse files
committed
fix: eager-load mostRelevantPost.user.groups on discussion index
During fulltext search the index populates mostRelevantPost.user, whose isAdmin() check would otherwise lazy-load groups per discussion.
1 parent 79810f6 commit f34de46

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

framework/core/src/Api/Resource/DiscussionResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function endpoints(): array
104104
'mostRelevantPost.user'
105105
])
106106
->defaultSort('-lastPostedAt')
107-
->eagerLoad(['state', 'user.groups', 'lastPostedUser.groups'])
107+
->eagerLoad(['state', 'user.groups', 'lastPostedUser.groups', 'mostRelevantPost.user.groups'])
108108
->paginate(),
109109
];
110110
}

0 commit comments

Comments
 (0)