missions ui

This commit is contained in:
alma 2025-05-06 13:37:51 +02:00
parent b0e9f1d816
commit bebb2196d6
2 changed files with 6 additions and 3 deletions

View File

@ -59,6 +59,7 @@ export async function GET(request: Request) {
projection: true,
participation: true,
services: true,
intention: true,
createdAt: true,
creator: {
select: {

View File

@ -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) */}
<div className="mt-2 text-sm text-gray-600 line-clamp-2">
{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.'}
</div>
</div>