WIP: Implement frontend

This commit is contained in:
grimsi
2022-07-22 15:16:19 +02:00
parent a06dfa7c47
commit e11611bbe6
11 changed files with 88 additions and 48 deletions
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { GamesService } from './games.service';
describe('GameserverApiService', () => {
let service: GamesService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(GamesService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,30 @@
import {Injectable} from '@angular/core';
import {GamesApi} from "../api/GamesApi";
import {HttpClient, HttpResponse} from "@angular/common/http";
import {Observable} from "rxjs";
import {DetectedGameDto} from "../models/dtos/DetectedGameDto";
import {GameOverviewDto} from "../models/dtos/GameOverviewDto";
import {LibraryApi} from "../api/LibraryApi";
@Injectable({
providedIn: 'root'
})
export class LibraryService implements LibraryApi {
private readonly apiPath = '/library';
constructor(private http: HttpClient) {
}
scanLibrary(): Observable<HttpResponse<Response>> {
return this.http.get<HttpResponse<Response>>(`${this.apiPath}/scan`);
}
downloadImages(): Observable<HttpResponse<Response>> {
return this.http.get<HttpResponse<Response>>(`${this.apiPath}/download-images`);
}
getFiles(): Observable<string[]> {
return this.http.get<string[]>(`${this.apiPath}/files`);
}
}