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 d325d3e commit ea627bcCopy full SHA for ea627bc
src/main/java/io/crops/warmletter/domain/share/service/SharePostLikeService.java
@@ -27,6 +27,14 @@ public SharePostLikeResponse getLikeCountAndStatus(Long sharePostId) {
27
if (sharePostId == null)
28
throw new ShareInvalidInputValue();
29
30
- return sharePostLikeRepository.getLikeCountAndStatus(sharePostId,memberId);
+ boolean isLikedInRedis = postLikeRedisManager.isLiked(sharePostId,memberId);
31
+
32
+ SharePostLikeResponse response = sharePostLikeRepository.getLikeCountAndStatus(sharePostId,memberId);
33
34
+ if (isLikedInRedis != response.isLiked()) {
35
+ return new SharePostLikeResponse(response.getLikeCount(), isLikedInRedis);
36
+ }
37
38
+ return response;
39
}
40
0 commit comments