WIP: Proceed with frontend implementation

This commit is contained in:
Simon Grimme
2022-07-22 12:54:39 +02:00
parent 38028b7e49
commit a06dfa7c47
14 changed files with 96 additions and 50 deletions
@@ -3,6 +3,7 @@ import {GamesApi} from "../api/GamesApi";
import {HttpClient} from "@angular/common/http";
import {Observable} from "rxjs";
import {DetectedGameDto} from "../models/dtos/DetectedGameDto";
import {GameOverviewDto} from "../models/dtos/GameOverviewDto";
@Injectable({
providedIn: 'root'
@@ -18,6 +19,14 @@ export class GamesService implements GamesApi {
return this.http.get<DetectedGameDto[]>(this.apiPath);
}
getGame(slug: String): Observable<DetectedGameDto> {
return this.http.get<DetectedGameDto>(`${this.apiPath}/game/${slug}`);
}
getGameOverviews(): Observable<GameOverviewDto[]> {
return this.http.get<GameOverviewDto[]>(`${this.apiPath}/game-overviews`);
}
getAllGameMappings(): Observable<Map<string, string>> {
return this.http.get<Map<string, string>>(`${this.apiPath}/game-mappings`);
}