File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import { observer } from "mobx-react" ;
22import { useState , useEffect } from "react" ;
3- import type { LogEntry , LogsResponse } from "../types/eval-protocol" ;
3+ import {
4+ LogsResponseSchema ,
5+ type LogEntry ,
6+ type LogsResponse ,
7+ } from "../types/eval-protocol" ;
48import { getApiUrl } from "../config" ;
59import Select from "./Select" ;
610import Button from "./Button" ;
@@ -86,7 +90,9 @@ export const LogsSection = observer(({ rolloutId }: LogsSectionProps) => {
8690 throw new Error ( `HTTP ${ response . status } : ${ response . statusText } ` ) ;
8791 }
8892
89- const data : LogsResponse = await response . json ( ) ;
93+ const data : LogsResponse = LogsResponseSchema . parse (
94+ await response . json ( )
95+ ) ;
9096 setLogs ( data . logs ) ;
9197 setHasLoadedOnce ( true ) ;
9298 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments