diff --git a/src/main/java/no/fintlabs/user/UserService.java b/src/main/java/no/fintlabs/user/UserService.java index d2a625a..346b32b 100644 --- a/src/main/java/no/fintlabs/user/UserService.java +++ b/src/main/java/no/fintlabs/user/UserService.java @@ -42,7 +42,7 @@ public void save(User user) { private Runnable onSaveNewUser(User user) { return () -> { User newUser = userRepository.save(user); - log.info("Create new user: " + user.getId()); + //log.info("Create new user: " + user.getId()); memberService.process(memberService.create(newUser)); userEntityProducerService.publish(newUser); }; @@ -51,10 +51,11 @@ private Runnable onSaveNewUser(User user) { private Consumer onSaveExistingUser(User user) { return existingUser -> { user.setId(existingUser.getId()); - log.info("Update user: " + user.getId()); + //log.info("Update user: " + user.getId()); memberService.process(memberService.create(user)); userRepository.save(user); - userEntityProducerService.publish(user); + User userToPublish = userRepository.findById(user.getId()).orElse(user); + userEntityProducerService.publish(userToPublish); }; }