Skip to content

Commit

Permalink
fix: season migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Fllorent0D committed Aug 27, 2023
1 parent 8d21784 commit c1ab0d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/seasons/season.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { Injectable } from '@nestjs/common';
import { SeasonEntry } from '../../entity/tabt-soap/TabTAPI_Port';
import { TabtClientService } from '../../common/tabt-client/tabt-client.service';
import { ContextService } from '../../common/context/context.service';
import { ConfigService } from '@nestjs/config';

@Injectable()
export class SeasonService {

constructor(
private tabtClient: TabtClientService,
private readonly context: ContextService
private readonly context: ContextService,
private readonly configService: ConfigService
) {
}

Expand All @@ -19,7 +21,7 @@ export class SeasonService {

async getCurrentSeason(): Promise<SeasonEntry> {
const season = await this.getSeasons();
return season.find(season => season.Season === this.context.context.runner.season);
return season.find(season => season.Season === Number(this.configService.get('CURRENT_SEASON')));
}

async getSeasonById(id: number): Promise<SeasonEntry> {
Expand Down

0 comments on commit c1ab0d8

Please sign in to comment.