From ef45caa86f04ad58e05184df85664ccd1aedc012 Mon Sep 17 00:00:00 2001 From: ferreo Date: Tue, 30 Jul 2024 20:48:08 +0100 Subject: [PATCH] moar --- src/hooks/usePackageData.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hooks/usePackageData.ts b/src/hooks/usePackageData.ts index 8b55e95..03d0d06 100644 --- a/src/hooks/usePackageData.ts +++ b/src/hooks/usePackageData.ts @@ -32,6 +32,11 @@ interface ErrorData { BuildNumber: number; } +interface ErroredResponse { + total: number; + packages: ErrorData[]; +} + interface PackagesResponse { total: number; packages: PackageData[]; @@ -111,8 +116,8 @@ const usePackageData = () => { setLoading(true); try { const response = await fetch('/api/errored'); - const data: ErrorData[] = await response.json(); - setErrPackages(data); + const data: ErroredResponse = await response.json(); + setErrPackages(data.packages); } catch (error) { console.error("Error fetching errored:", error); setErrPackages([]);