From bebb2196d6bf03b7923c973b033824b31cfc0680 Mon Sep 17 00:00:00 2001 From: alma Date: Tue, 6 May 2025 13:37:51 +0200 Subject: [PATCH] missions ui --- app/api/missions/route.ts | 1 + app/missions/page.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/api/missions/route.ts b/app/api/missions/route.ts index f11a375d..2124acb0 100644 --- a/app/api/missions/route.ts +++ b/app/api/missions/route.ts @@ -59,6 +59,7 @@ export async function GET(request: Request) { projection: true, participation: true, services: true, + intention: true, createdAt: true, creator: { select: { diff --git a/app/missions/page.tsx b/app/missions/page.tsx index 2cd05613..be147c2b 100644 --- a/app/missions/page.tsx +++ b/app/missions/page.tsx @@ -52,8 +52,8 @@ export default function MissionsPage() { throw new Error('Failed to fetch missions'); } const data = await response.json(); - // Debug log to check mission data structure - console.log("Mission data:", data.missions); + // Debug log to check mission data structure including intention + console.log("Mission data with intention:", data.missions); setMissions(data.missions || []); } catch (error) { console.error('Error fetching missions:', error); @@ -273,7 +273,9 @@ export default function MissionsPage() { {/* Description text (can be added from mission data) */}
- {mission.intention ? mission.intention.substring(0, 100) + (mission.intention.length > 100 ? '...' : '') : 'Pas de description disponible.'} + {mission.intention ? + (mission.intention.substring(0, 100) + (mission.intention.length > 100 ? '...' : '')) : + 'Pas de description disponible.'}