admin: new route to fill URLIds if they are not defined
This commit is contained in:
parent
8ae4d1c42f
commit
6d1ef0f51c
4 changed files with 56 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Reference in a new issue