We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e16e564 commit 060fb53Copy full SHA for 060fb53
1 file changed
vite-app/src/components/LogsSection.tsx
@@ -1,6 +1,10 @@
1
import { observer } from "mobx-react";
2
import { useState, useEffect } from "react";
3
-import type { LogEntry, LogsResponse } from "../types/eval-protocol";
+import {
4
+ LogsResponseSchema,
5
+ type LogEntry,
6
+ type LogsResponse,
7
+} from "../types/eval-protocol";
8
import { getApiUrl } from "../config";
9
import Select from "./Select";
10
import Button from "./Button";
@@ -86,7 +90,9 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
86
90
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
87
91
}
88
92
89
- const data: LogsResponse = await response.json();
93
+ const data: LogsResponse = LogsResponseSchema.parse(
94
+ await response.json()
95
+ );
96
setLogs(data.logs);
97
setHasLoadedOnce(true);
98
} catch (err) {
0 commit comments