File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,10 +28,14 @@ const DATA_EDIT_URL =
2828
2929async function findActivity ( id : string ) {
3030 const res = await fetch ( ACTIVITIES_API_URL , { cache : 'force-cache' } ) ;
31- if ( ! res . ok ) throw new Error ( `Failed to fetch activities: ${ res . status } ` ) ;
31+
32+ if ( ! res . ok ) throw new URIError ( `Failed to fetch activities: ${ res . status } ` ) ;
33+
3234 const externalData = ( await res . json ( ) ) as ExternalDeadlineItem [ ] ;
35+
3336 for ( const raw of externalData ) {
3437 const item = transformItem ( raw ) ;
38+
3539 for ( const event of item . events )
3640 if ( event . id === id ) return { item, event } ;
3741 }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export default async function RestaurantDetailPage({
7070 </ div >
7171
7272 { /* Food types */ }
73- { restaurant . food && restaurant . food . length > 0 && (
73+ { restaurant . food ?. [ 0 ] && (
7474 < div className = "text-sm" >
7575 < span className = "font-medium text-gray-700" >
7676 美食类型
You can’t perform that action at this time.
0 commit comments