beginning admin api

This commit is contained in:
AlecM33
2022-07-04 15:08:47 -04:00
parent f57cbc44bd
commit 3796aab81b
13 changed files with 166 additions and 28 deletions

View File

@@ -199,12 +199,7 @@ class GameManager {
checkAvailability = (code) => {
const game = this.activeGameRunner.activeGames[code.toUpperCase()];
if (game) {
const unassignedPerson = game.people.find((person) => person.assigned === false);
if (!unassignedPerson) {
return Promise.resolve(new Error(globals.ERROR_MESSAGE.GAME_IS_FULL));
} else {
return Promise.resolve({ accessCode: code, playerCount: getGameSize(game.deck), timerParams: game.timerParams });
}
return Promise.resolve({ accessCode: code, playerCount: getGameSize(game.deck), timerParams: game.timerParams });
} else {
return Promise.resolve(404);
}