admin: new route to fill URLIds if they are not defined

This commit is contained in:
nemunaire 2018-01-23 01:00:24 +01:00
parent 8ae4d1c42f
commit 6d1ef0f51c
4 changed files with 56 additions and 0 deletions

View file

@ -50,6 +50,14 @@ func init() {
func(exercice fic.Exercice, _ []byte) (interface{}, error) { return sync.SyncExerciceKeys(sync.GlobalImporter, exercice), nil })))
router.POST("/api/sync/exercices/:eid/quiz", apiHandler(exerciceHandler(
func(exercice fic.Exercice, _ []byte) (interface{}, error) { return sync.SyncExerciceMCQ(sync.GlobalImporter, exercice), nil })))
router.POST("/api/sync/exercices/:eid/fixurlid", apiHandler(exerciceHandler(
func(exercice fic.Exercice, _ []byte) (interface{}, error) {
if exercice.FixURLId() {
return exercice.Update()
}
return 0, nil
})))
}
func listExercices(_ httprouter.Params, body []byte) (interface{}, error) {