http service tests
This commit is contained in:
17
src/app/http.service.ts
Normal file
17
src/app/http.service.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Kinosaal } from '@infinimotion/model-frontend';
|
||||
import { HttpClient } from "@angular/common/http";
|
||||
import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class HttpService {
|
||||
private http = inject(HttpClient);
|
||||
|
||||
getAllKinosaal(): Observable<Kinosaal> {
|
||||
return this.http.get<Kinosaal>(`https://infinimotion.de/api/kinosaal`);
|
||||
}
|
||||
|
||||
addKinosaal(kinosaal: Omit<Kinosaal, 'id'>): Observable<Kinosaal> {
|
||||
return this.http.post<Kinosaal>(`https://infinimotion.de/api/kinosaal`, kinosaal);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user