Kaynağa Gözat

fix: return all 13 content categories in site detail content_metadata

fszontagh 3 ay önce
ebeveyn
işleme
c0439e7a94
2 değiştirilmiş dosya ile 15 ekleme ve 26 silme
  1. 5 25
      src/api/components/SitesEndpoint.ts
  2. 10 1
      src/database/Database.ts

+ 5 - 25
src/api/components/SitesEndpoint.ts

@@ -585,36 +585,16 @@ export class SitesEndpoint extends BaseEndpointComponent {
       const scheduledJobs = this.db.getScheduledJobs(site.id);
 
       // Build response with content change markers and URLs only (no content)
-      const contentMetadata: any = {
-        shipping_informations: latestContent.shipping.map(c => ({
+      const contentMetadata: any = {};
+      for (const [category, items] of Object.entries(latestContent)) {
+        contentMetadata[category] = (items as any[]).map(c => ({
           id: c.id,
           url: c.url,
           changed: Boolean(c.changed),
           enabled: Boolean(c.enabled),
           last_updated: c.updated_at
-        })),
-        contacts: latestContent.contacts.map(c => ({
-          id: c.id,
-          url: c.url,
-          changed: Boolean(c.changed),
-          enabled: Boolean(c.enabled),
-          last_updated: c.updated_at
-        })),
-        terms_of_conditions: latestContent.terms.map(c => ({
-          id: c.id,
-          url: c.url,
-          changed: Boolean(c.changed),
-          enabled: Boolean(c.enabled),
-          last_updated: c.updated_at
-        })),
-        faq: latestContent.faq.map(c => ({
-          id: c.id,
-          url: c.url,
-          changed: Boolean(c.changed),
-          enabled: Boolean(c.enabled),
-          last_updated: c.updated_at
-        }))
-      };
+        }));
+      }
 
       res.json({
         site: {

+ 10 - 1
src/database/Database.ts

@@ -1031,7 +1031,16 @@ export class SiteDatabase {
       shipping: [],
       contacts: [],
       terms: [],
-      faq: []
+      faq: [],
+      services: [],
+      about: [],
+      team: [],
+      blog: [],
+      pricing: [],
+      testimonials: [],
+      gallery: [],
+      landing: [],
+      other: []
     };
 
     // Group by content_type and URL (latest version of each URL)