From de9a201c93e0351c9167bbb4cc71535c541eb7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20B=C3=B6ckmann?= <75972296+bencodes07@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:21:38 +0200 Subject: [PATCH] build: added logging to debug --- src/main/java/com/MeetMate/user/UserService.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/MeetMate/user/UserService.java b/src/main/java/com/MeetMate/user/UserService.java index f478655..bc8dd4e 100644 --- a/src/main/java/com/MeetMate/user/UserService.java +++ b/src/main/java/com/MeetMate/user/UserService.java @@ -53,18 +53,31 @@ public List getAllUsers() { @Transactional public void registerNewUser(MultiValueMap data) throws NameAlreadyBoundException { + System.out.println("Received registration data: " + data); + String email = data.getFirst("email"); String name = data.getFirst("name"); String password = data.getFirst("password"); String role = data.getFirst("role"); + + System.out.println("Parsed email: " + email); + System.out.println("Parsed name: " + name); + System.out.println("Parsed password: " + password); + Long associatedCompany = null; String associatedCompanyStr = data.getFirst("associatedCompany"); + System.out.println("Associated company string: " + associatedCompanyStr); + if (associatedCompanyStr != null && !associatedCompanyStr.isEmpty()) { try { associatedCompany = Long.parseLong(associatedCompanyStr); + System.out.println("Parsed associatedCompany: " + associatedCompany); } catch (NumberFormatException e) { + System.out.println("ERROR: Failed to parse associatedCompany" + e); throw new IllegalArgumentException("Invalid associatedCompany value", e); } + } else { + System.out.println("No associatedCompany provided"); } UserRole userRole = (role == null || role.isEmpty()) ? UserRole.CLIENT : UserRole.valueOf(role);