From a48d62765cb4dd5c3d4e5727d59c50501dcbd35f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <git@minelli.swiss>
Date: Tue, 25 Feb 2025 17:26:13 +0100
Subject: [PATCH] ExercisesRoutes => Update exercise gitlab info after deletion

---
 ExpressAPI/src/routes/ExerciseRoutes.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ExpressAPI/src/routes/ExerciseRoutes.ts b/ExpressAPI/src/routes/ExerciseRoutes.ts
index 022c916..eced4af 100644
--- a/ExpressAPI/src/routes/ExerciseRoutes.ts
+++ b/ExpressAPI/src/routes/ExerciseRoutes.ts
@@ -118,7 +118,12 @@ class ExerciseRoutes implements RoutesManager {
 
         await db.exercise.update({
                                      where: { id: req.boundParams.exercise!.id },
-                                     data : { deleted: true }
+                                     data : {
+                                         name              : newName,
+                                         gitlabLastInfo    : repository as unknown as Prisma.JsonObject,
+                                         gitlabLastInfoDate: new Date(),
+                                         deleted           : true
+                                     }
                                  });
 
         return req.session.sendResponse(res, StatusCodes.OK);
-- 
GitLab