fix: update todosCount checks and refactor key accomplishments extraction

- Changed todosCount checks in AchievementCard and ChallengeCard to ensure proper handling of undefined values.
- Updated extractKeyAccomplishments method to be asynchronous and count all related todos using Prisma, improving accuracy in task completion metrics.
- Refactored relatedItems and todosCount handling for better clarity and functionality in ManagerSummaryService.
This commit is contained in:
Julien Froidefond
2025-09-29 16:20:35 +02:00
parent d45a04d347
commit 3fcada65f6
3 changed files with 24 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ export function AchievementCard({
)}
{/* Count de todos */}
{achievement.todosCount && achievement.todosCount > 0 && (
{achievement.todosCount !== undefined && achievement.todosCount > 0 && (
<div className="flex items-center gap-1 text-xs text-[var(--muted-foreground)]">
<span>📋</span>
<span>{achievement.todosCount} todo{achievement.todosCount > 1 ? 's' : ''}</span>