Skip to content

Commit

Permalink
Merge branch 'next' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Dec 5, 2023
2 parents b72a07e + 0a8fc9d commit 85ae33b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion projects/gameboard-ui/src/app/api/game.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class GameService {
}

public getGamePlayState(gameId: string): Observable<GamePlayState> {
return this.http.get<GamePlayState>(`${this.url}/game/${gameId}/play-state}`);
return this.http.get<GamePlayState>(`${this.url}/game/${gameId}/play-state`);
}

public getSyncStartState(gameId: string): Observable<SyncStartGameState> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,18 @@ export class PlayerEnrollComponent implements OnInit, OnDestroy {
);
}

protected handleEnroll(userId: string, gameId: string): void {
protected async handleEnroll(userId: string, gameId: string): Promise<void> {
const model = { userId, gameId } as NewPlayer;
this.isEnrolling = true;
this.errors = [];

this.api.create(model).pipe(first()).subscribe(p => {
this.enrolled(p);
});
try {
const player = await firstValueFrom(this.api.create(model));
this.enrolled(player);
}
catch (err) {
this.errors.push(err);
}
}

protected async handleUnenroll(p: Player): Promise<void> {
Expand Down

0 comments on commit 85ae33b

Please sign in to comment.