~jan0sch/smederee

Showing details for patch d9c728b56e9152a68d83095792beda784c0ef838.
2023-05-19 (Fri), 3:39 PM - Jens Grassel - d9c728b56e9152a68d83095792beda784c0ef838

Update and delete ticket projects in sync with vcs repos.

Summary of changes
1 files modified with 5 lines added and 2 lines removed
  • modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala with 5 added and 2 removed lines
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-16 10:04:38.254018641 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-16 10:04:38.254018641 +0000
@@ -1091,8 +1091,10 @@
               darcsConfig.repositoriesDirectory.toPath.resolve(user.name.toString).resolve(repo.name.toString)
             )
           )
-          _    <- repoDir.traverse(directory => deleteRepositoryDirectory(repositoryOwnerName)(directory))
-          _    <- repo.traverse(repo => vcsMetadataRepo.deleteVcsRepository(repo))
+          _ <- repoDir.traverse(directory => deleteRepositoryDirectory(repositoryOwnerName)(directory))
+          _ <- repo.traverse(repo =>
+            vcsMetadataRepo.deleteVcsRepository(repo) *> ticketsProjectRepo.deleteProject(repo.convert)
+          )
           resp <- SeeOther(Location(redirectUri))
         } yield resp
       }
@@ -1177,6 +1179,7 @@
                     )
                     for {
                       _    <- vcsMetadataRepo.updateVcsRepository(repoMetadata)
+                      _    <- ticketsProjectRepo.updateProject(repoMetadata.convert)
                       resp <- SeeOther(Location(repoUri))
                     } yield resp
                 }