Services: create and move shows-api service
This commit is contained in:
parent
46b267d672
commit
0a6fda1512
3 changed files with 3 additions and 3 deletions
|
|
@ -1,22 +0,0 @@
|
|||
import {inject, Injectable} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
import {ShowsApiResponse} from './shows-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ShowsApiService {
|
||||
|
||||
private readonly url: string = "https://shows.everest.tailscale/api/";
|
||||
private showsEndpoint: string
|
||||
private http: HttpClient = inject(HttpClient);
|
||||
|
||||
constructor() {
|
||||
this.showsEndpoint = this.url + "shows/"
|
||||
}
|
||||
|
||||
getShows(): Observable<ShowsApiResponse> {
|
||||
return this.http.get<ShowsApiResponse>(this.showsEndpoint)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue