f9420e5848
Co-authored-by: Janis Eccarius <eccariusjanis@gmail.com> Reviewed-on: #11
23 lines
639 B
TypeScript
23 lines
639 B
TypeScript
import { Injectable, inject } from '@angular/core';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { Observable } from 'rxjs';
|
|
|
|
export interface JoinTournamentResponse {
|
|
botId: string;
|
|
difficulty: string;
|
|
status: string;
|
|
}
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
export class OfficialBotService {
|
|
private readonly http = inject(HttpClient);
|
|
private readonly base = '/api/bots/official';
|
|
|
|
joinTournament(tournamentId: string, difficulty: string): Observable<JoinTournamentResponse> {
|
|
return this.http.post<JoinTournamentResponse>(`${this.base}/join-tournament`, {
|
|
tournamentId,
|
|
difficulty,
|
|
});
|
|
}
|
|
}
|