@@ -56,11 +56,13 @@ import {
5656 compactSummaryOf ,
5757 dateKeyOf ,
5858 daysBetween ,
59+ firstTextOf ,
5960 formatMoment ,
6061 formatPeriod ,
6162 isPublicForm ,
6263 normalizeAgendaType ,
6364 previewText ,
65+ textListOf ,
6466} from '../../components/Activity/Hackathon/utility' ;
6567
6668interface HackathonDetailProps {
@@ -79,9 +81,10 @@ export const getServerSideProps = compose<{ id: string }>(
7981 cache ( ) ,
8082 errorLogger ,
8183 async ( { params } ) => {
82- const activity = await new ActivityModel ( ) . getOne ( params ! . id ) ;
84+ if ( ! params ? .id ) return { notFound : true , props : { } } ;
8385
84- const { appId, tableIdMap } = activity . databaseSchema ;
86+ const activity = await new ActivityModel ( ) . getOne ( params ! . id ) ;
87+ const { appId, tableIdMap } = activity . databaseSchema || { } ;
8588
8689 if ( ! appId || ! tableIdMap ) return { notFound : true , props : { } } ;
8790
@@ -122,7 +125,7 @@ const HackathonDetail: FC<HackathonDetailProps> = observer(({ activity, hackatho
122125 { people, organizations, agenda, prizes, templates, projects } = hackathon ;
123126 const { forms } = databaseSchema ;
124127 const formMap = ( forms || { } ) as Partial < Record < FormGroupKey , TableFormView [ ] > > ;
125- const summaryText = ( summary as string ) || '' ;
128+ const summaryText = textListOf ( summary ) . join ( ' · ' ) || firstTextOf ( summary ) ;
126129 const agendaItems = [ ...agenda ] . sort (
127130 ( { startedAt : left } , { startedAt : right } ) =>
128131 new Date ( ( left as string ) || 0 ) . getTime ( ) - new Date ( ( right as string ) || 0 ) . getTime ( ) ,
0 commit comments