Explorar o código

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 hai 3 semanas
pai
achega
e3d676cd98
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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)
     }