diff --git a/admin/api/exercice.go b/admin/api/exercice.go index dd1ac5ba..69324d71 100644 --- a/admin/api/exercice.go +++ b/admin/api/exercice.go @@ -35,6 +35,15 @@ func init() { router.GET("/api/exercices/:eid/keys/:kid", apiHandler(keyHandler(showExerciceKey))) router.PUT("/api/exercices/:eid/keys/:kid", apiHandler(keyHandler(updateExerciceKey))) router.DELETE("/api/exercices/:eid/keys/:kid", apiHandler(keyHandler(deleteExerciceKey))) + + + // Synchronize + router.GET("/api/sync/exercices/:eid/files", apiHandler(exerciceHandler( + func(exercice fic.Exercice, _ []byte) (interface{}, error) { return sync.SyncExerciceFiles(sync.GlobalImporter, exercice), nil }))) + router.GET("/api/sync/exercices/:eid/hints", apiHandler(exerciceHandler( + func(exercice fic.Exercice, _ []byte) (interface{}, error) { return sync.SyncExerciceHints(sync.GlobalImporter, exercice), nil }))) + router.GET("/api/sync/exercices/:eid/keys", apiHandler(exerciceHandler( + func(exercice fic.Exercice, _ []byte) (interface{}, error) { return sync.SyncExerciceKeys(sync.GlobalImporter, exercice), nil }))) } func listExercices(_ httprouter.Params, body []byte) (interface{}, error) {