From 3205f3e8e756cd08439a847a4668625739ea8e0e Mon Sep 17 00:00:00 2001 From: Michael Harlow <94586121+michaelharlow@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:09:12 -0500 Subject: [PATCH] fix: No void type for ResponseEntity body * fix: No void type for ResponseEntity body * fix: No void type for ResponseEntity body --- .../com/avengers/example/controller/AccountController.java | 1 - .../java/com/avengers/example/service/AccountService.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/avengers/example/controller/AccountController.java b/src/main/java/com/avengers/example/controller/AccountController.java index 61aebe0..a4a2a24 100644 --- a/src/main/java/com/avengers/example/controller/AccountController.java +++ b/src/main/java/com/avengers/example/controller/AccountController.java @@ -16,7 +16,6 @@ public class AccountController { private final AccountService accountService; - // TODO: Resolve compilation issue here @PostMapping("/account") public ResponseEntity save(@RequestBody Account account) { diff --git a/src/main/java/com/avengers/example/service/AccountService.java b/src/main/java/com/avengers/example/service/AccountService.java index 09d2f00..b316c17 100644 --- a/src/main/java/com/avengers/example/service/AccountService.java +++ b/src/main/java/com/avengers/example/service/AccountService.java @@ -15,9 +15,9 @@ public class AccountService private final AccountRepository accountRepository; @Transactional - public void create(Account account) + public Account create(Account account) { - accountRepository.save(account); + return accountRepository.save(account); } public List findAll()