tournament in coming

This commit is contained in:
2024-04-18 20:08:13 +02:00
parent 630ef709ab
commit ae0a5abfcd
11 changed files with 265 additions and 287 deletions

View File

@ -29,13 +29,13 @@ class Tourmanents
/**
*
* @param {Number} nb_players
* @param {Number} nb_participants
* @param {String} name
* @returns {Response}
*/
async createTournament(nb_players, name = "")
async createTournament(nb_participants, name = "")
{
let response = await this.client._post("/api/tournaments/", {nb_players: nb_players, name: name});
let response = await this.client._post("/api/tournaments/", {nb_participants: nb_participants, name: name});
return response;
}
@ -58,15 +58,9 @@ class Tourmanents
let tournaments = [];``
response_data.forEach(tournament_data => {
tournaments.push(new Tourmanent(this.client,
tournament_data.name,
tournament_data.nb_players,
tournament_data.round,
tournament_data.started,
tournament_data.finished,
tournament_data.rounds,
tournament_data.id,
tournament_data.state));
let tournament = new Tourmanent(this.client, tournament_data.id);
tournament.import(tournament_data);
tournaments.push(tournament);
});
return tournaments;