From 537a2eb183ef8c16b30430b729bdd9e03c8e026b Mon Sep 17 00:00:00 2001 From: Kalane Date: Tue, 14 Sep 2021 15:06:42 +0200 Subject: [PATCH] fix: season is a float --- server-v2/app/Services/MatchService.ts | 4 ++-- server-v2/database/migrations/1631392754960_matches.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server-v2/app/Services/MatchService.ts b/server-v2/app/Services/MatchService.ts index 75bd5d4..15d2aeb 100644 --- a/server-v2/app/Services/MatchService.ts +++ b/server-v2/app/Services/MatchService.ts @@ -85,7 +85,7 @@ class MatchService { ): Promise { console.time('getMatches') - let matches: SerializedMatch[] = [] + const matches: SerializedMatch[] = [] const matchesToGetFromRiot: MatchlistDto = [] for (let i = 0; i < matchIds.length; ++i) { const matchSaved = await Match.query() @@ -112,7 +112,7 @@ class MatchService { // TODO: Serialize match from DB + put it in Redis + push it in "matches" const serializedMatches = BasicMatchSerializer.serialize(parsedMatches, puuid, true) - matches = [...matches, ...serializedMatches] + matches.push(...serializedMatches) } // Todo: check if we need to sort here diff --git a/server-v2/database/migrations/1631392754960_matches.ts b/server-v2/database/migrations/1631392754960_matches.ts index 3d36ac2..62f99fa 100644 --- a/server-v2/database/migrations/1631392754960_matches.ts +++ b/server-v2/database/migrations/1631392754960_matches.ts @@ -13,7 +13,7 @@ export default class Matches extends BaseSchema { table.string('region', 4).notNullable() table.integer('result').notNullable() - table.integer('season').notNullable() + table.float('season').notNullable() table.integer('game_duration').notNullable() // table.integer('blue_team_id').notNullable()