File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
src/components/IntegrationGrid Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,25 @@ function useCMSIntegrations() {
175175 setIntegrations ( transformedData ) ;
176176 setError ( null ) ;
177177 } catch ( err ) {
178- console . error ( 'Failed to fetch integrations from CMS:' , err ) ;
179- setError ( err instanceof Error ? err . message : 'Failed to fetch integrations' ) ;
180- setIntegrations ( [ ] ) ;
178+ console . error ( 'Error loading integrations data from endpoint. Falling back to static JSON file.' ) ;
179+
180+ // Fallback to static JSON file
181+ try {
182+ const fallbackResponse = await fetch ( '/integrations-fallback.json' ) ;
183+
184+ if ( ! fallbackResponse . ok ) {
185+ throw new Error ( `Failed to load fallback data: ${ fallbackResponse . status } ` ) ;
186+ }
187+
188+ const fallbackData = await fallbackResponse . json ( ) ;
189+ const transformedData = transformCMSData ( fallbackData . data || [ ] ) ;
190+ setIntegrations ( transformedData ) ;
191+ setError ( null ) ;
192+ } catch ( fallbackErr ) {
193+ console . error ( 'Failed to load fallback integrations data:' , fallbackErr ) ;
194+ setError ( fallbackErr instanceof Error ? fallbackErr . message : 'Failed to fetch integrations' ) ;
195+ setIntegrations ( [ ] ) ;
196+ }
181197 } finally {
182198 setLoading ( false ) ;
183199 }
You can’t perform that action at this time.
0 commit comments