feat: load shows from frontend API

This commit is contained in:
2026-04-29 12:20:39 +02:00
parent c67c2c7d18
commit e1977e49c3
2 changed files with 152 additions and 37 deletions
@@ -0,0 +1,29 @@
import { inject, Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { API_BASE_URL } from './api-config.token';
export type ShowListItem = {
id: number;
title: string;
slug: string;
summary: string;
poster_image: string;
};
type ShowListResponse = {
results: ShowListItem[];
};
@Injectable({
providedIn: 'root',
})
export class ShowsApiService {
private readonly http = inject(HttpClient);
private readonly apiBaseUrl = inject(API_BASE_URL);
listShows(): Observable<ShowListResponse> {
return this.http.get<ShowListResponse>(`${this.apiBaseUrl}/shows/`);
}
}