Skip to content

Commit

Permalink
build: added logging to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
bencodes07 committed Sep 9, 2024
1 parent ea17dfb commit de9a201
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/MeetMate/user/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,31 @@ public List<User> getAllUsers() {

@Transactional
public void registerNewUser(MultiValueMap<String, String> 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);

Expand Down

0 comments on commit de9a201

Please sign in to comment.