From 19712f6f7412b52798291a61bcf8534b67c826b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me>
Date: Mon, 27 May 2024 19:16:15 +0200
Subject: [PATCH] Correction => Add description on list

---
 .../exercise/subcommands/ExerciseCorrectionCommand.ts         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/NodeApp/src/commander/exercise/subcommands/ExerciseCorrectionCommand.ts b/NodeApp/src/commander/exercise/subcommands/ExerciseCorrectionCommand.ts
index 6dfddd1..5e6310b 100644
--- a/NodeApp/src/commander/exercise/subcommands/ExerciseCorrectionCommand.ts
+++ b/NodeApp/src/commander/exercise/subcommands/ExerciseCorrectionCommand.ts
@@ -39,8 +39,10 @@ class ExerciseCorrectionCommand extends CommanderCommand {
 
     private getCorrections(assignment: Assignment): Array<CorrectionResume> {
         return assignment.corrections.map(correction => {
+            const authors = correction.name.replace(correction.assignmentName, '').split('-')[2].trim();
+
             return {
-                name : correction.name.replace(correction.assignmentName, '').split('-')[2].trim(),
+                name : (correction.correctionDescription && correction.correctionDescription != '' ? `${ correction.correctionDescription } (${ authors })` : authors),
                 value: correction.correctionCommit?.web_url?.replace('/commit/', '/tree/') ?? ''
             };
         });
-- 
GitLab