admin: add the ability to sync only one exercice
This commit is contained in:
parent
dc4a4925e3
commit
2ccc59b4fa
3 changed files with 65 additions and 24 deletions
|
@ -52,6 +52,11 @@ func init() {
|
|||
router.PUT("/api/exercices/:eid/tags", apiHandler(exerciceHandler(updateExerciceTags)))
|
||||
|
||||
// Synchronize
|
||||
router.POST("/api/sync/themes/:thid/exercices/:eid", apiHandler(themedExerciceHandler(
|
||||
func(theme fic.Theme, exercice fic.Exercice, _ []byte) (interface{}, error) {
|
||||
_, _, errs := sync.SyncExercice(sync.GlobalImporter, theme, exercice.Path, nil)
|
||||
return errs, nil
|
||||
})))
|
||||
router.POST("/api/sync/exercices/:eid/files", apiHandler(exerciceHandler(
|
||||
func(exercice fic.Exercice, _ []byte) (interface{}, error) {
|
||||
return sync.SyncExerciceFiles(sync.GlobalImporter, exercice), nil
|
||||
|
|
Reference in a new issue