Browse Source

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 tháng trước cách đây
mục cha
commit
77141d6bdb

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

@@ -39,11 +39,14 @@ export class QdrantPage {
       ]);
       ]);
 
 
       if (statsResponse.success && statsResponse.data) {
       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) {
       if (healthResponse.success && healthResponse.data) {
-        this.health = healthResponse.data;
+        const healthData = healthResponse.data as any;
+        this.health = healthData.data || healthData;
       }
       }
 
 
       this.renderQdrantOverview();
       this.renderQdrantOverview();

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

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