@@ -92,26 +92,28 @@ export class PostLikeService implements Service {
92
92
} ,
93
93
} )
94
94
95
- // create notification
96
- await this . notificationService . createOrUpdate ( {
97
- fkUserId : post . fk_user_id ,
98
- actorId : signedUserId ,
99
- actionId : post . id ,
100
- type : 'postLike' ,
101
- action : {
102
- postLike : {
103
- post_like_id : postLike . id ,
104
- actor_display_name : signedUser . profile ?. display_name || '' ,
105
- actor_thumbnail : signedUser . profile ?. thumbnail || '' ,
106
- actor_username : signedUser . username ,
107
- post_id : likesPost . id ,
108
- post_title : likesPost . title || '' ,
109
- post_url_slug : likesPost . url_slug || '' ,
110
- post_writer_username : likesPost . user . username ,
111
- type : 'postLike' ,
95
+ if ( post . fk_user_id !== signedUserId ) {
96
+ // create notification
97
+ await this . notificationService . createOrUpdate ( {
98
+ fkUserId : post . fk_user_id ,
99
+ actorId : signedUserId ,
100
+ actionId : post . id ,
101
+ type : 'postLike' ,
102
+ action : {
103
+ postLike : {
104
+ post_like_id : postLike . id ,
105
+ actor_display_name : signedUser . profile ?. display_name || '' ,
106
+ actor_thumbnail : signedUser . profile ?. thumbnail || '' ,
107
+ actor_username : signedUser . username ,
108
+ post_id : likesPost . id ,
109
+ post_title : likesPost . title || '' ,
110
+ post_url_slug : likesPost . url_slug || '' ,
111
+ post_writer_username : likesPost . user . username ,
112
+ type : 'postLike' ,
113
+ } ,
112
114
} ,
113
- } ,
114
- } )
115
+ } )
116
+ }
115
117
116
118
const unscored = this . utils . checkUnscore ( post . body ! . concat ( post . title || '' ) )
117
119
if ( ! unscored ) {
0 commit comments