typescript-typenfehler behoben.. npm run lint läuft nun fehlerfrei durch.

This commit is contained in:
Codex Agent
2025-11-22 11:49:47 +01:00
parent 6c78d7e281
commit eb41cb6194
74 changed files with 469 additions and 396 deletions

View File

@@ -40,8 +40,9 @@ async function handleResponse<T>(response: Response): Promise<T> {
const data = await response.json().catch(() => null);
if (!response.ok) {
const error = new Error((data && data.error && data.error.message) || 'Request failed');
(error as any).code = data?.error?.code ?? response.status;
const errorPayload = data as { error?: { message?: string; code?: unknown } } | null;
const error = new Error(errorPayload?.error?.message ?? 'Request failed') as Error & { code?: unknown };
error.code = errorPayload?.error?.code ?? response.status;
throw error;
}
@@ -78,4 +79,3 @@ export async function fetchGalleryPhotos(token: string, cursor?: string | null,
return handleResponse<GalleryPhotosResponse>(response);
}