Back to modulo
This commit is contained in:
parent
13f093bb61
commit
068deb4960
|
@ -57,12 +57,12 @@ export class CreateTrackScan {
|
|||
* @returns The runnerCard whom's id you provided.
|
||||
*/
|
||||
public async getCard(): Promise<RunnerCard> {
|
||||
const id = parseInt(this.card.toString().replace(/^2(0)*/, ""));
|
||||
const track = await getConnection().getRepository(RunnerCard).findOne({ id: id }, { relations: ["runner"] });
|
||||
if (!track) {
|
||||
const id = this.card % 20000000;
|
||||
const runnerCard = await getConnection().getRepository(RunnerCard).findOne({ id: id }, { relations: ["runner"] });
|
||||
if (!runnerCard) {
|
||||
throw new RunnerCardNotFoundError();
|
||||
}
|
||||
return track;
|
||||
return runnerCard;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue