Skip to content

Commit

Permalink
Merge pull request #125 from GeneralMagicio/fix/early-project-round-f…
Browse files Browse the repository at this point in the history
…etch

Don't allow fetch round record before it has started
  • Loading branch information
aminlatifi authored Nov 1, 2024
2 parents 56dc9b5 + eec60e2 commit fc03581
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/resolvers/projectResolver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Max, Min } from 'class-validator';
import { Brackets, getMetadataArgsStorage, Repository } from 'typeorm';
import {
Brackets,
getMetadataArgsStorage,
LessThan,
Repository,
} from 'typeorm';
import { Service } from 'typedi';
import {
Arg,
Expand Down Expand Up @@ -2203,7 +2208,7 @@ export class ProjectResolver {

if (qfRoundNumber) {
const qfRound = await QfRound.findOne({
where: { roundNumber: qfRoundNumber },
where: { roundNumber: qfRoundNumber, beginDate: LessThan(new Date()) },
select: ['id', 'beginDate', 'endDate'],
loadEagerRelations: false,
});
Expand All @@ -2215,7 +2220,10 @@ export class ProjectResolver {

if (earlyAccessRoundNumber) {
const earlyAccessRound = await EarlyAccessRound.findOne({
where: { roundNumber: earlyAccessRoundNumber },
where: {
roundNumber: earlyAccessRoundNumber,
startDate: LessThan(new Date()),
},
select: ['id', 'startDate', 'endDate'],
loadEagerRelations: false,
});
Expand Down

0 comments on commit fc03581

Please sign in to comment.