Files
manage/frontend/src/api/jellyseerr.ts
T
Developer 54851779fb fix(build): JellyseerStatsResponse export/import spelling + test mock type
The frontend production build (tsc -b) was failing, which blocked deployment:

- api/jellyseerr.ts exported `JellyseerrStatsResponse` (double-r) while every
  import used `JellyseerStatsResponse` (single-r) — a mismatch TS reported as
  "no exported member" (with a misleading identical-name suggestion). The
  sibling types (JellyseerStat, JellyseerRecentRequest) are single-r, so
  align the export to single-r. (tsc --noEmit missed it because the root
  tsconfig is solution-style; tsc -b builds the app project and catches it.)
- RequestsTab.test.tsx's useJellyseerrStats mock returned a partial object
  that didn't satisfy UseQueryResult's full shape; cast via a typed helper.

`npm run build` (tsc -b && vite build) now succeeds; 184/184 tests + ESLint clean.
2026-07-12 16:30:59 +00:00

33 lines
756 B
TypeScript

import { get } from "./shared";
export interface JellyseerStat {
key: string;
label: string;
value: number;
}
export interface JellyseerRecentRequest {
id?: number | string;
type?: number | string;
name?: string;
status?: string;
media_status?: string;
created_at?: number | string;
}
export interface JellyseerStatsResponse {
stats: JellyseerStat[];
recent: JellyseerRecentRequest[];
detail?: string | null;
}
/** Fetch Jellyseerr request stats for a Jellyfin service instance. */
export async function fetchJellyseerrStats(
jellyfinServiceId?: string,
): Promise<JellyseerStatsResponse> {
return get<JellyseerStatsResponse>(
"/api/jellyseerr/stats",
jellyfinServiceId ? { jellyfin_service_id: jellyfinServiceId } : undefined,
);
}