@@ -172,8 +172,8 @@ async def get_comment(uuid: UUID, user=Depends(UnionAuth(auto_error=False, allow
172172 raise ObjectNotFound (Comment , uuid )
173173 base_data = CommentGet .model_validate (comment )
174174 if user :
175- base_data .is_liked = comment .has_reaction (user .get ("id" ), Reaction .LIKE )
176- base_data .is_disliked = comment .has_reaction (user .get ("id" ), Reaction .DISLIKE )
175+ base_data .is_liked = comment .has_reaction (user .get ("id" ), Reaction .LIKE )
176+ base_data .is_disliked = comment .has_reaction (user .get ("id" ), Reaction .DISLIKE )
177177 return base_data
178178
179179
@@ -267,8 +267,8 @@ async def get_comments(
267267 base_data = comment_validator .model_validate (comment )
268268 if current_user_id :
269269 reaction = user_reactions .get (comment .uuid )
270- base_data .is_liked = ( reaction == Reaction .LIKE )
271- base_data .is_disliked = ( reaction == Reaction .DISLIKE )
270+ base_data .is_liked = reaction == Reaction .LIKE
271+ base_data .is_disliked = reaction == Reaction .DISLIKE
272272 comments_with_like .append (base_data )
273273
274274 result .comments = comments_with_like
@@ -320,8 +320,8 @@ async def update_comment(uuid: UUID, comment_update: CommentUpdate, user=Depends
320320 )
321321
322322 updated_comment = CommentGet .model_validate (updated_comment )
323- updated_comment .is_liked = comment .has_reaction (user .get ("id" ), Reaction .LIKE )
324- updated_comment .is_disliked = comment .has_reaction (user .get ("id" ), Reaction .DISLIKE )
323+ updated_comment .is_liked = comment .has_reaction (user .get ("id" ), Reaction .LIKE )
324+ updated_comment .is_disliked = comment .has_reaction (user .get ("id" ), Reaction .DISLIKE )
325325 return updated_comment
326326
327327
@@ -387,9 +387,9 @@ async def like_comment(
387387 )
388388 .first ()
389389 )
390-
391- comment .is_liked = ( reaction == Reaction .LIKE )
392- comment .is_disliked = ( reaction == Reaction .DISLIKE )
390+
391+ comment .is_liked = reaction == Reaction .LIKE
392+ comment .is_disliked = reaction == Reaction .DISLIKE
393393
394394 if existing_reaction and existing_reaction .reaction != reaction :
395395 new_reaction = CommentReaction .update (session = db .session , id = existing_reaction .uuid , reaction = reaction )
0 commit comments