fix: return 404 when tournament not found

This commit is contained in:
starnakin 2023-12-21 00:23:10 +01:00
parent 6295c5120f
commit 4eaa35584d
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class Tourmanent
let response = await this.client._get(`/api/tournaments/${id}`); let response = await this.client._get(`/api/tournaments/${id}`);
if (response.status === 404) if (response.status === 404)
return null; return 1;
let response_data = await response.json(); let response_data = await response.json();

View File

@ -17,7 +17,8 @@ class Tourmanents
async getTournament(id) async getTournament(id)
{ {
let tournament = new Tourmanent(this.client); let tournament = new Tourmanent(this.client);
await tournament.init(id); if (await tournament.init(id))
return null;
return tournament; return tournament;
} }