Changeset 194776a for src/main/java/it/finki/charitable/controller
- Timestamp:
- 09/03/21 18:34:05 (3 years ago)
- Branches:
- master
- Children:
- 5306751
- Parents:
- f8007b3
- Location:
- src/main/java/it/finki/charitable/controller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/charitable/controller/DonationPostController.java
rf8007b3 r194776a 172 172 173 173 DonationPost post = donationPostService.getById(postid); 174 FundsCollected funds = new FundsCollected(" online", amount);174 FundsCollected funds = new FundsCollected("Online donation", amount); 175 175 fundsCollectedService.save(funds); 176 176 -
src/main/java/it/finki/charitable/controller/UserProfileController.java
rf8007b3 r194776a 105 105 } 106 106 107 @RequestMapping( "/addFunds")107 @RequestMapping(value = "/addFunds", method = RequestMethod.POST) 108 108 public String addFunds(@RequestParam Long postid, 109 109 @RequestParam String type, … … 111 111 112 112 DonationPost post = donationPostService.getById(postid); 113 FundsCollected funds = new FundsCollected(type, amount); 114 fundsCollectedService.save(funds); 115 116 post.getFundsCollected().add(funds); 117 donationPostService.save(post); 113 if(post.getUser().getUsername().equals(SecurityContextHolder.getContext().getAuthentication().getName())) { 114 FundsCollected funds = new FundsCollected(type, amount); 115 fundsCollectedService.save(funds); 116 post.getFundsCollected().add(funds); 117 donationPostService.save(post); 118 } 118 119 return "redirect:/myPosts"; 119 120 }
Note:
See TracChangeset
for help on using the changeset viewer.