mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
WIP: Implement frontend
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {GamesApi} from "../api/GamesApi";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {Observable} from "rxjs";
|
||||
import {DetectedGameDto} from "../models/dtos/DetectedGameDto";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class GamesService implements GamesApi {
|
||||
|
||||
private readonly apiPath = '/games';
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
}
|
||||
|
||||
getAllGames(): Observable<DetectedGameDto[]> {
|
||||
return this.http.get<DetectedGameDto[]>(this.apiPath);
|
||||
}
|
||||
|
||||
getAllGameMappings(): Observable<Map<string, string>> {
|
||||
return this.http.get<Map<string, string>>(`${this.apiPath}/game-mappings`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user