Skip to content

Commit

Permalink
Merge pull request #61 from GeneralMagicio/joinWithEarlyAccessRound
Browse files Browse the repository at this point in the history
join get user donations query with early access round
  • Loading branch information
ae2079 authored Sep 19, 2024
2 parents 003ccfd + 14394e8 commit e9bbf28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/entities/donation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ export class Donation extends BaseEntity {
@ManyToOne(_type => EarlyAccessRound, { eager: true, nullable: true })
earlyAccessRound?: EarlyAccessRound | null;

@Field({ nullable: true })
@RelationId((donation: Donation) => donation.earlyAccessRound)
@Column({ nullable: true })
earlyAccessRoundId: number;
Expand Down
5 changes: 2 additions & 3 deletions src/resolvers/donationResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ export class DonationResolver {
.leftJoinAndSelect('donation.project', 'project')
.leftJoinAndSelect('donation.user', 'user')
.leftJoinAndSelect('donation.qfRound', 'qfRound')
.leftJoinAndSelect('donation.earlyAccessRound', 'earlyAccessRound')
.where(`donation.userId = ${userId}`)
.orderBy(
`donation.${orderBy.field}`,
Expand Down Expand Up @@ -908,9 +909,7 @@ export class DonationResolver {
}
await donation.save();
} else {
const activeRound = await findActiveEarlyAccessRound();
donation.earlyAccessRound = activeRound;
donation.earlyAccessRoundId = activeRound?.id as number;
donation.earlyAccessRound = await findActiveEarlyAccessRound();
await donation.save();
}
let priceChainId;
Expand Down

0 comments on commit e9bbf28

Please sign in to comment.