Skip to content

Commit

Permalink
Merge pull request #107 from GeneralMagicio/fix/match-pending-donation
Browse files Browse the repository at this point in the history
Fixed issue in matching pending donation
  • Loading branch information
aminlatifi authored Oct 23, 2024
2 parents db85966 + 5b0f6c1 commit 333c2db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/repositories/projectRoundRecordRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export async function updateOrCreateProjectRoundRecord(
qfRoundId?: number | null,
earlyAccessRoundId?: number | null,
): Promise<ProjectRoundRecord> {
if (!qfRoundId && !earlyAccessRoundId) {
throw new Error('No round specified on updateOrCreateProjectRoundRecord');
}
try {
let query = Donation.createQueryBuilder('donation')
.select('SUM(COALESCE(donation.amount))', 'totalDonationAmount')
Expand Down
4 changes: 4 additions & 0 deletions src/resolvers/donationResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,10 @@ export class DonationResolver {
activeQfRoundForProject.isEligibleNetwork(networkId)
) {
donation.qfRound = activeQfRoundForProject;
} else {
throw new Error(
i18n.__(translationErrorMessagesKeys.ROUND_NOT_FOUND),
);
}
if (draftDonationEnabled && draftDonationId) {
const draftDonation = await DraftDonation.findOne({
Expand Down

0 comments on commit 333c2db

Please sign in to comment.