This commit is contained in:
ferreo 2024-07-30 20:48:08 +01:00
parent 352d7aa896
commit ef45caa86f

View File

@ -32,6 +32,11 @@ interface ErrorData {
BuildNumber: number; BuildNumber: number;
} }
interface ErroredResponse {
total: number;
packages: ErrorData[];
}
interface PackagesResponse { interface PackagesResponse {
total: number; total: number;
packages: PackageData[]; packages: PackageData[];
@ -111,8 +116,8 @@ const usePackageData = () => {
setLoading(true); setLoading(true);
try { try {
const response = await fetch('/api/errored'); const response = await fetch('/api/errored');
const data: ErrorData[] = await response.json(); const data: ErroredResponse = await response.json();
setErrPackages(data); setErrPackages(data.packages);
} catch (error) { } catch (error) {
console.error("Error fetching errored:", error); console.error("Error fetching errored:", error);
setErrPackages([]); setErrPackages([]);