sync: return binding between challenge.txt IDs and DB item

This commit is contained in:
nemunaire 2019-11-25 14:57:21 +01:00
parent 4a490b1a33
commit d97ecde3fb
5 changed files with 20 additions and 10 deletions

View file

@ -65,11 +65,13 @@ func init() {
})))
router.POST("/api/sync/exercices/:eid/hints", apiHandler(exerciceHandler(
func(exercice fic.Exercice, _ []byte) (interface{}, error) {
return sync.SyncExerciceHints(sync.GlobalImporter, exercice), nil
_, errs := sync.SyncExerciceHints(sync.GlobalImporter, exercice)
return errs, nil
})))
router.POST("/api/sync/exercices/:eid/flags", apiHandler(exerciceHandler(
func(exercice fic.Exercice, _ []byte) (interface{}, error) {
return sync.SyncExerciceFlags(sync.GlobalImporter, exercice), nil
_, errs := sync.SyncExerciceFlags(sync.GlobalImporter, exercice)
return errs, nil
})))
router.POST("/api/sync/exercices/:eid/fixurlid", apiHandler(exerciceHandler(

View file

@ -70,11 +70,13 @@ func init() {
})))
router.POST("/api/sync/themes/:thid/exercices/:eid/hints", apiHandler(exerciceHandler(
func(exercice fic.Exercice, _ []byte) (interface{}, error) {
return sync.SyncExerciceHints(sync.GlobalImporter, exercice), nil
_, errs := sync.SyncExerciceHints(sync.GlobalImporter, exercice)
return errs, nil
})))
router.POST("/api/sync/themes/:thid/exercices/:eid/keys", apiHandler(exerciceHandler(
func(exercice fic.Exercice, _ []byte) (interface{}, error) {
return sync.SyncExerciceFlags(sync.GlobalImporter, exercice), nil
_, errs := sync.SyncExerciceFlags(sync.GlobalImporter, exercice)
return errs, nil
})))
router.POST("/api/sync/themes/:thid/fixurlid", apiHandler(themeHandler(