From fedbd240afbefd3889370b3c8b3cb12b58fc0f49 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Thu, 5 Mar 2026 22:55:19 +0100 Subject: [PATCH] Corriger le mapping des champs StoryBlok (category, resume en Textarea, dossier) --- src/lib/storyblok.ts | 8 ++++---- src/pages/spectacles/[id].astro | 2 +- src/pages/spectacles/index.astro | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/storyblok.ts b/src/lib/storyblok.ts index 87d93ae..e0cb65e 100644 --- a/src/lib/storyblok.ts +++ b/src/lib/storyblok.ts @@ -1,4 +1,4 @@ -import { useStoryblokApi, renderRichText } from '@storyblok/astro'; +import { useStoryblokApi } from '@storyblok/astro'; import type { SbBlokData } from '@storyblok/astro'; function getVersion(): 'draft' | 'published' { @@ -45,15 +45,15 @@ export function mapStoryToSpectacle(story: any): Spectacle { return { id: story.slug, title: c.titre || story.name, - category: c.categorie || 'tout-public', + category: c.category || 'tout-public', retired: c.retire || false, age: c.age || '', duration: c.duree || '', - summary: c.resume ? renderRichText(c.resume) : '', + summary: c.resume || '', credits: c.credits || '', image: c.image?.filename || '', gallery: (c.galerie || []).map((a: any) => a.filename), - dossierPro: c.dossier_pro?.filename || '', + dossierPro: c.dossier?.filename || '', _blok: c, }; } diff --git a/src/pages/spectacles/[id].astro b/src/pages/spectacles/[id].astro index d5357b0..fd16ca8 100644 --- a/src/pages/spectacles/[id].astro +++ b/src/pages/spectacles/[id].astro @@ -97,7 +97,7 @@ if (!spectacle) { {spectacle.summary && ( -
+

{spectacle.summary}

)} {spectacle.credits && ( diff --git a/src/pages/spectacles/index.astro b/src/pages/spectacles/index.astro index c5bd35c..e70ef7f 100644 --- a/src/pages/spectacles/index.astro +++ b/src/pages/spectacles/index.astro @@ -80,7 +80,7 @@ const retraites = spectacles.filter(s => s.retired); )}
{spectacle.summary && ( -
+

{spectacle.summary}

)}
{spectacle.summary && ( -
+

{spectacle.summary}

)}