@@ -60,20 +60,20 @@ export class PostService {
60
60
'post.postImages' ,
61
61
'postImage' ,
62
62
'postImage.status = :status' ,
63
- { status : 'activated' } ,
63
+ { status : StatusEnum . ACTIVATED } ,
64
64
)
65
65
. leftJoin (
66
66
'post.postLikes' ,
67
67
'postLike' ,
68
68
'postLike.status = :status and postLike.postId = post.id and postLike.userId = :currentUserId' ,
69
69
{
70
- status : 'activated' ,
70
+ status : StatusEnum . ACTIVATED ,
71
71
currentUserId,
72
72
} ,
73
73
)
74
74
. addSelect ( [ 'postLike.id' ] )
75
- . where ( 'post.status = :status' , { status : 'activated' } )
76
- . andWhere ( 'user.status = :status' , { status : 'activated' } )
75
+ . where ( 'post.status = :status' , { status : StatusEnum . ACTIVATED } )
76
+ . andWhere ( 'user.status = :status' , { status : StatusEnum . ACTIVATED } )
77
77
. andWhere ( 'user.id NOT IN (:currentUserId)' , {
78
78
currentUserId : [ currentUserId ] ,
79
79
} )
@@ -121,14 +121,14 @@ export class PostService {
121
121
'post.postImages' ,
122
122
'postImage' ,
123
123
'postImage.status = :status AND postImage.orderNum = :orderNum' ,
124
- { status : 'activated' , orderNum : 1 } ,
124
+ { status : StatusEnum . ACTIVATED , orderNum : 1 } ,
125
125
)
126
126
. leftJoinAndSelect (
127
127
'post.postLikes' ,
128
128
'postLike' ,
129
129
'postLike.status = :likeStatus' ,
130
130
{
131
- likeStatus : 'activated' ,
131
+ likeStatus : StatusEnum . ACTIVATED ,
132
132
} ,
133
133
)
134
134
. leftJoinAndSelect ( 'postLike.user' , 'postLikeUser' )
@@ -137,11 +137,11 @@ export class PostService {
137
137
'postComment' ,
138
138
'postComment.status = :commentStatus' ,
139
139
{
140
- commentStatus : 'activated' ,
140
+ commentStatus : StatusEnum . ACTIVATED ,
141
141
} ,
142
142
)
143
143
. leftJoinAndSelect ( 'postComment.user' , 'postCommentUser' )
144
- . where ( 'post.status = :status' , { status : 'activated' } )
144
+ . where ( 'post.status = :status' , { status : StatusEnum . ACTIVATED } )
145
145
. andWhere ( 'post.user.id = :userId' , { userId } )
146
146
. select ( [
147
147
'post.id' ,
@@ -317,20 +317,20 @@ export class PostService {
317
317
'post.postImages' ,
318
318
'postImage' ,
319
319
'postImage.status = :status' ,
320
- { status : 'activated' } ,
320
+ { status : StatusEnum . ACTIVATED } ,
321
321
)
322
322
. leftJoinAndSelect (
323
323
'post.postStyletags' ,
324
324
'postStyletag' ,
325
325
'postStyletag.status = :status' ,
326
- { status : 'activated' } ,
326
+ { status : StatusEnum . ACTIVATED } ,
327
327
)
328
328
. leftJoinAndSelect ( 'postStyletag.styletag' , 'styletag' )
329
329
. leftJoinAndSelect (
330
330
'post.postClothings' ,
331
331
'postClothing' ,
332
332
'postClothing.status = :status' ,
333
- { status : 'activated' } ,
333
+ { status : StatusEnum . ACTIVATED } ,
334
334
)
335
335
. leftJoinAndSelect ( 'postClothing.clothing' , 'clothing' )
336
336
. leftJoinAndSelect ( 'post.user' , 'user' )
@@ -395,15 +395,15 @@ export class PostService {
395
395
'post.postImages' ,
396
396
'postImage' ,
397
397
'postImage.status = :imageStatus' ,
398
- { imageStatus : 'activated' } ,
398
+ { imageStatus : StatusEnum . ACTIVATED } ,
399
399
)
400
400
. leftJoinAndSelect ( 'post.user' , 'user' )
401
401
. leftJoinAndSelect (
402
402
'post.postLikes' ,
403
403
'postLike' ,
404
404
'postLike.status = :likeStatus AND postLike.user.id NOT IN (:...blockedUserIds)' ,
405
405
{
406
- likeStatus : 'activated' ,
406
+ likeStatus : StatusEnum . ACTIVATED ,
407
407
blockedUserIds : blockedUserIds . length > 0 ? blockedUserIds : [ - 1 ] , // 차단된 사용자가 없으면 무효화된 조건 (-1)
408
408
} ,
409
409
)
@@ -413,7 +413,7 @@ export class PostService {
413
413
'postComment' ,
414
414
'postComment.status = :commentStatus AND postComment.user.id NOT IN (:...blockedUserIds)' ,
415
415
{
416
- commentStatus : 'activated' ,
416
+ commentStatus : StatusEnum . ACTIVATED ,
417
417
blockedUserIds : blockedUserIds . length > 0 ? blockedUserIds : [ - 1 ] ,
418
418
} ,
419
419
)
@@ -422,18 +422,20 @@ export class PostService {
422
422
'post.postClothings' ,
423
423
'postClothing' ,
424
424
'postClothing.status = :clothingStatus' ,
425
- { clothingStatus : 'activated' } ,
425
+ { clothingStatus : StatusEnum . ACTIVATED } ,
426
426
)
427
427
. leftJoinAndSelect ( 'postClothing.clothing' , 'clothing' )
428
428
. leftJoinAndSelect (
429
429
'post.postStyletags' ,
430
430
'postStyletag' ,
431
431
'postStyletag.status = :styletagStatus' ,
432
- { styletagStatus : 'activated' } ,
432
+ { styletagStatus : StatusEnum . ACTIVATED } ,
433
433
)
434
434
. leftJoinAndSelect ( 'postStyletag.styletag' , 'styletag' )
435
435
. where ( 'post.id = :postId' , { postId } )
436
- . andWhere ( 'post.status = :postStatus' , { postStatus : 'activated' } )
436
+ . andWhere ( 'post.status = :postStatus' , {
437
+ postStatus : StatusEnum . ACTIVATED ,
438
+ } )
437
439
. getOne ( ) ;
438
440
}
439
441
@@ -499,7 +501,7 @@ export class PostService {
499
501
{
500
502
user : { id : userId } ,
501
503
isRepresentative : true ,
502
- status : 'activated' ,
504
+ status : StatusEnum . ACTIVATED ,
503
505
} ,
504
506
{ isRepresentative : false } ,
505
507
) ;
0 commit comments