We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e7717b commit ef4747aCopy full SHA for ef4747a
app/controllers/Profiles/main.ts
@@ -9,12 +9,14 @@ export default class ProfilesController {
9
const user = await User.query()
10
.where({ username })
11
.preload('avatar')
12
- .preload('posts')
13
- .preload('likes')
+ .preload('posts', (postsQuery: any) => {
+ postsQuery.preload('media')
14
+ postsQuery.withCount('likes')
15
+ postsQuery.withCount('comments')
16
+ })
17
.preload('followers')
18
.preload('following')
19
.withCount('posts')
- .withCount('likes')
20
.withCount('followers')
21
.withCount('following')
22
.firstOrFail()
0 commit comments