feat(web): route season and episode release decks
This commit is contained in:
@@ -22,7 +22,9 @@ export interface ApiSeries {
|
||||
|
||||
export interface ApiEpisode {
|
||||
id: number;
|
||||
series_id: number;
|
||||
season_id: number;
|
||||
season_number: number;
|
||||
number: number;
|
||||
title: string;
|
||||
air_date: string | null;
|
||||
@@ -54,6 +56,16 @@ export async function fetchSeries(seriesId: number): Promise<ApiSeries | null> {
|
||||
}
|
||||
}
|
||||
|
||||
/** One episode by row id — the `/episodes/{id}/releases` deep link's lookup. */
|
||||
export async function fetchEpisode(episodeId: number): Promise<ApiEpisode | null> {
|
||||
try {
|
||||
const response = await fetch(`/api/episodes/${episodeId}`);
|
||||
return response.ok ? ((await response.json()) as ApiEpisode) : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchSeasons(seriesId: number): Promise<SeasonsOutcome> {
|
||||
try {
|
||||
const response = await fetch(`/api/series/${seriesId}/seasons`);
|
||||
|
||||
Reference in New Issue
Block a user