diff options
| author | Akash Keshav <112591754+domesticchores@users.noreply.github.com> | 2025-03-18 14:33:29 -0400 | 
|---|---|---|
| committer | Akash Keshav <112591754+domesticchores@users.noreply.github.com> | 2025-03-18 14:33:29 -0400 | 
| commit | 6b3c96302f3fc1aa5ad24676f5891dc2bb696414 (patch) | |
| tree | 5118bf39546ecb9569a67e0c97a88a0361d4ee6f /ufund-api/src/main | |
| parent | 054857f51d1397d1122219e407a25c18472733f6 (diff) | |
| parent | ac33cc6884c0d3b3e112e6dde6154aa123016d93 (diff) | |
| download | JellySolutions-6b3c96302f3fc1aa5ad24676f5891dc2bb696414.tar.gz JellySolutions-6b3c96302f3fc1aa5ad24676f5891dc2bb696414.tar.bz2 JellySolutions-6b3c96302f3fc1aa5ad24676f5891dc2bb696414.zip  | |
Merge branch 'funding_basket' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b-jellysolutions into funding_basket
Diffstat (limited to '')
| -rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java | 4 | ||||
| -rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/UserFileDAO.java | 8 | 
2 files changed, 2 insertions, 10 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java index 9592490..6356fd9 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java @@ -17,10 +17,10 @@ import org.springframework.web.bind.annotation.RequestMapping;  import org.springframework.web.bind.annotation.RequestParam;  import org.springframework.web.bind.annotation.RestController; +import com.ufund.api.ufundapi.DuplicateKeyException;  import com.ufund.api.ufundapi.model.Need;  import com.ufund.api.ufundapi.model.Need.GoalType;  import com.ufund.api.ufundapi.service.CupboardService; -import com.ufund.api.ufundapi.DuplicateKeyException;  @RestController  @RequestMapping("cupboard") @@ -59,7 +59,7 @@ public class CupboardController {          } catch (DuplicateKeyException ex) {              return new ResponseEntity<>(HttpStatus.CONFLICT);          } catch (IllegalArgumentException ex) { -            return new ResponseEntity<>(HttpStatus.UNPROCESSABLE_ENTITY); +            return new ResponseEntity<>(HttpStatus.BAD_REQUEST);          } catch (IOException ex) {              return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);          } 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 f8357e4..def21c6 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 @@ -10,9 +10,7 @@ import org.springframework.beans.factory.annotation.Value;  import org.springframework.stereotype.Component;  import com.fasterxml.jackson.databind.ObjectMapper; -import com.ufund.api.ufundapi.model.Need;  import com.ufund.api.ufundapi.model.User; -import com.ufund.api.ufundapi.model.User.UserType;  @Component  public class UserFileDAO implements UserDAO { @@ -84,24 +82,18 @@ public class UserFileDAO implements UserDAO {      public User updateUser(User user) throws IOException {          synchronized (users) {              if (users.containsKey(user.getUsername())) { -                System.out.println("in the dao " + user);                  // var old = users.put(user.getUsername(), user);                  // user.copyPassword(old); -                System.out.println("basket needs: " + user.getBasketNeeds() + "type :" + user.getType());                  if (user.getBasketNeeds() == null || user.getType() == null) { -                    System.out.println("USING CRUTCH");                      User oldData = users.get(user.getUsername());                      User crutch = new User(oldData.getUsername(), 0, new ArrayList<Integer>(), oldData.getType());                      crutch.copyPassword(oldData);                      users.put(user.getUsername(), crutch);                  } else { -                    System.out.println("GOOD DATA");                      var old = users.put(user.getUsername(), user);                      user.copyPassword(old);                  }                  save(); -                System.out.println("end of dao " + user); -                System.out.println("updated user with: " + users.get(user.getUsername()));                  return user;              } else {                  return null;  | 
