@@ -109,9 +109,23 @@ export class PostService {
109
109
'postImage.status = :status AND postImage.orderNum = :orderNum' ,
110
110
{ status : 'activated' , orderNum : 1 } ,
111
111
)
112
- . leftJoinAndSelect ( 'post.postLikes' , 'postLike' )
112
+ . leftJoinAndSelect (
113
+ 'post.postLikes' ,
114
+ 'postLike' ,
115
+ 'postLike.status = :likeStatus' ,
116
+ {
117
+ likeStatus : 'activated' ,
118
+ } ,
119
+ )
113
120
. leftJoinAndSelect ( 'postLike.user' , 'postLikeUser' )
114
- . leftJoinAndSelect ( 'post.postComments' , 'postComment' )
121
+ . leftJoinAndSelect (
122
+ 'post.postComments' ,
123
+ 'postComment' ,
124
+ 'postComment.status = :commentStatus' ,
125
+ {
126
+ commentStatus : 'activated' ,
127
+ } ,
128
+ )
115
129
. leftJoinAndSelect ( 'postComment.user' , 'postCommentUser' )
116
130
. where ( 'post.status = :status' , { status : 'activated' } )
117
131
. andWhere ( 'post.user.id = :userId' , { userId } )
@@ -377,9 +391,23 @@ export class PostService {
377
391
{ imageStatus : 'activated' } ,
378
392
)
379
393
. leftJoinAndSelect ( 'post.user' , 'user' )
380
- . leftJoinAndSelect ( 'post.postLikes' , 'postLike' )
394
+ . leftJoinAndSelect (
395
+ 'post.postLikes' ,
396
+ 'postLike' ,
397
+ 'postLike.status = :likeStatus' ,
398
+ {
399
+ likeStatus : 'activated' ,
400
+ } ,
401
+ )
381
402
. leftJoinAndSelect ( 'postLike.user' , 'postLikeUser' )
382
- . leftJoinAndSelect ( 'post.postComments' , 'postComment' )
403
+ . leftJoinAndSelect (
404
+ 'post.postComments' ,
405
+ 'postComment' ,
406
+ 'postComment.status = :commentStatus' ,
407
+ {
408
+ commentStatus : 'activated' ,
409
+ } ,
410
+ )
383
411
. leftJoinAndSelect ( 'postComment.user' , 'postCommentUser' )
384
412
. leftJoinAndSelect (
385
413
'post.postClothings' ,
0 commit comments