Skip to content

Commit

Permalink
Fix: DonationDAO turned into non-static so changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Apr 15, 2026
1 parent fce473b commit 68bbbd0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import javafx.scene.control.ButtonType;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import ntnu.systemutvikling.team6.controller.components.LoaderScene;
import ntnu.systemutvikling.team6.database.DAO.DonationDAO;
import ntnu.systemutvikling.team6.database.DatabaseConnection;
import ntnu.systemutvikling.team6.models.Charity;
import ntnu.systemutvikling.team6.models.user.User;

Expand All @@ -24,6 +26,8 @@ public class DonationPageController {

@FXML private TextField donationSearchField;

private DonationDAO donationSender = new DonationDAO(new DatabaseConnection());

/**
* Initialize method for the donation page. Sets the charity name label to the name of the charity
* that is being donated to. The charity is set from the original page it was called from when the
Expand Down Expand Up @@ -116,7 +120,7 @@ public void Donate(ActionEvent event) {
* @param amount
*/
public void processDonation(Charity charity, User user, double amount) {
DonationDAO.addDonation(charity, user, amount);
donationSender.addDonation(charity, user, amount);
}

/**
Expand Down

0 comments on commit 68bbbd0

Please sign in to comment.