@@ -8,7 +8,7 @@ import { Suspense, useEffect, useState } from 'react';
88import CalendarControls from '@/components/CalendarControls' ;
99import { View , Views } from 'react-big-calendar' ;
1010import { transformApiDates } from '@/utils/dateutils' ;
11- import { OrganizationList } from '@/utils/organizations ' ;
11+ import { AllOrganizationList as OrganizationList } from '@acm-uiuc/js-shared ' ;
1212import { useSearchParams } from 'next/navigation' ;
1313
1414const defaultEvent : CalendarEventDetailProps = {
@@ -39,29 +39,18 @@ const Calendar = () => {
3939 async function fetcher ( ) {
4040 const urls = [
4141 `${ baseurl } /api/v1/events` ,
42- `${ baseurl } /api/v1/organizations` ,
4342 ] ;
4443
4544 try {
46- const [ eventsResponse , organizationsResponse ] =
45+ const [ eventsResponse ] =
4746 await Promise . allSettled ( urls . map ( ( url ) => fetch ( url ) ) ) ;
4847 if ( eventsResponse . status === 'fulfilled' ) {
4948 const eventsData = await eventsResponse . value . json ( ) ;
5049 setAllEvents ( transformApiDates ( eventsData as IEvent [ ] ) ) ;
5150 } else {
5251 setAllEvents ( [ ] ) ; // Handle error for events fetch
5352 }
54-
55- // Handle organizations response
56- if ( organizationsResponse . status === 'fulfilled' ) {
57- const organizationsData = await organizationsResponse . value . json ( ) ;
58- setValidOrganizations ( organizationsData as string [ ] ) ;
59- if ( ! organizationsData . includes ( hostFilter ) ) {
60- setHostFilter ( '' ) ;
61- }
62- } else {
63- setValidOrganizations ( OrganizationList ) ;
64- }
53+ setValidOrganizations ( OrganizationList ) ;
6554 } catch ( err ) {
6655 console . error ( 'Error in processing fetch results:' , err ) ;
6756 setAllEvents ( [ ] ) ; // Fallback error handling for critical failure
@@ -115,7 +104,7 @@ const Calendar = () => {
115104 null ,
116105 '' ,
117106 baseURL +
118- `/calendar?host=${ e . target . value . replaceAll ( ' ' , '+' ) } ` ,
107+ `/calendar?host=${ e . target . value . replaceAll ( ' ' , '+' ) } ` ,
119108 ) ;
120109 }
121110 } }
0 commit comments