From c1ab0d8586bf78bbd1c53e24c78544d5b1296254 Mon Sep 17 00:00:00 2001 From: Florent Cardoen Date: Sun, 27 Aug 2023 09:58:13 +0200 Subject: [PATCH] fix: season migration --- src/services/seasons/season.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/seasons/season.service.ts b/src/services/seasons/season.service.ts index 0a303c03..990cd585 100644 --- a/src/services/seasons/season.service.ts +++ b/src/services/seasons/season.service.ts @@ -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 ) { } @@ -19,7 +21,7 @@ export class SeasonService { async getCurrentSeason(): Promise { 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 {