Przeglądaj źródła

Fix clear pattern selectors not loading patterns

Changed fetchPatternFiles to use correct endpoint /list_theta_rho_files
instead of non-existent /api/patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 3 tygodni temu
rodzic
commit
e3d676cd98
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      frontend/src/pages/SettingsPage.tsx

+ 3 - 2
frontend/src/pages/SettingsPage.tsx

@@ -209,9 +209,10 @@ export function SettingsPage() {
 
   const fetchPatternFiles = async () => {
     try {
-      const response = await fetch('/api/patterns')
+      const response = await fetch('/list_theta_rho_files')
       const data = await response.json()
-      setPatternFiles(data.patterns?.map((p: { file: string }) => p.file) || [])
+      // Response is a flat array of file paths
+      setPatternFiles(Array.isArray(data) ? data : [])
     } catch (error) {
       console.error('Error fetching pattern files:', error)
     }