Răsfoiți Sursa

feat: add content ID and enabled status to shop content responses

Changes:
- Added 'id' field to content items in GET /api/shops/:id response
- Added 'id' field to content items in GET /api/shops/:id/results response
- Added 'enabled' field to both endpoints showing URL enable/disable status

This allows the frontend to properly manage content URLs using the
PATCH /api/shops/:id/content/:contentId endpoint for enabling/disabling URLs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fszontagh 8 luni în urmă
părinte
comite
2fe87b0783
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      src/api/components/ShopsEndpoint.ts

+ 10 - 0
src/api/components/ShopsEndpoint.ts

@@ -514,23 +514,31 @@ export class ShopsEndpoint extends BaseEndpointComponent {
       // Build response with content change markers and URLs only (no content)
       const contentMetadata: any = {
         shipping_informations: latestContent.shipping.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
         }))
       };
@@ -627,9 +635,11 @@ export class ShopsEndpoint extends BaseEndpointComponent {
                        'faq';
 
         grouped[typeKey].push({
+          id: content.id,
           url: content.url,
           content: content.content,
           changed: Boolean(content.changed),
+          enabled: Boolean(content.enabled),
           last_updated: content.updated_at,
           title: content.title
         });