Ignore:
Timestamp:
09/03/21 11:25:12 (3 years ago)
Author:
KostaFortumanov <kfortumanov@…>
Branches:
master
Children:
f8007b3
Parents:
5577566
Message:

Added moderator class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/charitable/controller/DonationPostController.java

    r5577566 rf0d5cb7  
    11package it.finki.charitable.controller;
    22
    3 import it.finki.charitable.entities.AppUser;
    4 import it.finki.charitable.entities.DonationInformation;
    5 import it.finki.charitable.entities.DonationPost;
    6 import it.finki.charitable.entities.FundsCollected;
     3import it.finki.charitable.entities.*;
    74import it.finki.charitable.services.DonationInformationService;
    85import it.finki.charitable.services.DonationPostService;
     
    183180        DonationInformation donationInformation = new DonationInformation(amount, post.getId(), post.getTitle());
    184181        donationInformationService.save(donationInformation);
    185         AppUser user = userService.loadUserByUsername(SecurityContextHolder.getContext().getAuthentication().getName());
     182        MainUser user = (MainUser) userService.loadUserByUsername(SecurityContextHolder.getContext().getAuthentication().getName());
    186183        user.getDonationInformation().add(donationInformation);
    187184        userService.saveUser(user);
Note: See TracChangeset for help on using the changeset viewer.