Services/shows: add function to get single show with id

This commit is contained in:
Toast 2025-02-03 18:02:19 +01:00
parent 6d185a7eb8
commit 8a2fbcf43e
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,6 @@
import {Show} from './show';
export interface ShowsApiIdResponse {
status: string
show: Show
}

View file

@ -3,6 +3,7 @@ import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {ShowsApiResponse} from '../../interfaces/shows-api-response';
import {ShowsApiCreation} from '../../interfaces/shows-api-creation';
import {ShowsApiIdResponse} from '../../interfaces/shows-api-id-response';
@Injectable({
providedIn: 'root'
@ -21,6 +22,10 @@ export class ShowsApiService {
return this.http.get<ShowsApiResponse>(this.showsEndpoint)
}
getShow(id: string): Observable<ShowsApiIdResponse> {
return this.http.get<ShowsApiIdResponse>(this.showsEndpoint + "id/" + id )
}
sendShow(newShow: {}) {
return this.http.post<ShowsApiCreation>(this.showsEndpoint, newShow)
}