Bläddra i källkod

fix: qdrant stats data unwrapping and webhook deliveries key mismatch

- QdrantPage: unwrap nested {data: {...}} envelope from stats API
- WebhooksPage: handle both 'recent_deliveries' and 'deliveries' keys
fszontagh 3 månader sedan
förälder
incheckning
77141d6bdb
2 ändrade filer med 8 tillägg och 4 borttagningar
  1. 5 2
      web/src/components/pages/QdrantPage.ts
  2. 3 2
      web/src/components/pages/WebhooksPage.ts

+ 5 - 2
web/src/components/pages/QdrantPage.ts

@@ -39,11 +39,14 @@ export class QdrantPage {
       ]);
 
       if (statsResponse.success && statsResponse.data) {
-        this.stats = statsResponse.data;
+        // Unwrap nested data envelope if present (Qdrant endpoints use {data: {...}, success: true})
+        const statsData = statsResponse.data as any;
+        this.stats = statsData.data || statsData;
       }
 
       if (healthResponse.success && healthResponse.data) {
-        this.health = healthResponse.data;
+        const healthData = healthResponse.data as any;
+        this.health = healthData.data || healthData;
       }
 
       this.renderQdrantOverview();

+ 3 - 2
web/src/components/pages/WebhooksPage.ts

@@ -194,9 +194,10 @@ export class WebhooksPage {
       try {
         const response = await this.apiService.getWebhook(site.id);
         if (response.success && response.data) {
+          const data = response.data as any;
           this.webhookData.set(site.id, {
-            webhook: response.data.webhook,
-            deliveries: response.data.deliveries
+            webhook: data.webhook,
+            deliveries: data.recent_deliveries || data.deliveries || []
           });
         } else {
           // No webhook configured - this is normal