Implement reaction panel with backend support

This commit is contained in:
Tim
2025-07-09 18:17:35 +08:00
parent 5554594123
commit 4627d34dbe
7 changed files with 213 additions and 51 deletions

View File

@@ -28,6 +28,9 @@ public class ReactionController {
@RequestBody ReactionRequest req,
Authentication auth) {
Reaction reaction = reactionService.reactToPost(auth.getName(), postId, req.getType());
if (reaction == null) {
return ResponseEntity.noContent().build();
}
return ResponseEntity.ok(toDto(reaction));
}
@@ -36,6 +39,9 @@ public class ReactionController {
@RequestBody ReactionRequest req,
Authentication auth) {
Reaction reaction = reactionService.reactToComment(auth.getName(), commentId, req.getType());
if (reaction == null) {
return ResponseEntity.noContent().build();
}
return ResponseEntity.ok(toDto(reaction));
}