From 72d614074a3cd578322931af647c6f0a65a23dfd Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Wed, 26 Feb 2025 16:00:35 -0500 Subject: Tested user http calls and fixed update user --- .../src/main/java/com/ufund/api/ufundapi/persistence/UserFileDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/persistence') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserFileDAO.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserFileDAO.java index 0f30824..18eec18 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserFileDAO.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserFileDAO.java @@ -95,7 +95,7 @@ public class UserFileDAO implements UserDAO { @Override public User createUser(User user) throws IOException { synchronized (users) { - if (getUser(user.getName()) != null) { + if (getUser(user.getName()) == null) { User newUser = new User(user); users.put(newUser.getName(), newUser); save(); @@ -131,7 +131,7 @@ public class UserFileDAO implements UserDAO { /** * Delete a user matching the name * - * @param name The name of the user + * @param name The name of the user * * @return True if deleted, false otherwise * @throws IOException If there was an IO issue saving the file -- cgit v1.2.3