sync: Better perform exception in exercices

This commit is contained in:
nemunaire 2023-07-09 19:05:58 +02:00
parent edbb867f62
commit dc83efa868
8 changed files with 45 additions and 34 deletions

View file

@ -142,7 +142,8 @@ func declareSyncExercicesRoutes(router *gin.RouterGroup) {
theme := c.MustGet("theme").(*fic.Theme)
exceptions := sync.LoadThemeException(sync.GlobalImporter, theme)
c.JSON(http.StatusOK, flatifySyncErrors(sync.SyncExercices(sync.GlobalImporter, theme, exceptions)))
_, errs := sync.SyncExercices(sync.GlobalImporter, theme, exceptions)
c.JSON(http.StatusOK, flatifySyncErrors(errs))
})
apiSyncExercicesRoutes := router.Group("/exercices/:eid")
apiSyncExercicesRoutes.Use(ExerciceHandler)
@ -152,7 +153,7 @@ func declareSyncExercicesRoutes(router *gin.RouterGroup) {
exceptions := sync.LoadExerciceException(sync.GlobalImporter, theme, exercice, nil)
_, _, errs := sync.SyncExercice(sync.GlobalImporter, theme, exercice.Path, nil, exceptions)
_, _, _, errs := sync.SyncExercice(sync.GlobalImporter, theme, exercice.Path, nil, exceptions)
c.JSON(http.StatusOK, flatifySyncErrors(errs))
})
apiSyncExercicesRoutes.POST("/files", func(c *gin.Context) {