api: remote route takes advantage from builds functions

This commit is contained in:
nemunaire 2019-09-07 01:25:42 +02:00
parent ded583008a
commit f2fc142869
6 changed files with 83 additions and 6 deletions

View file

@ -52,6 +52,11 @@ func init() {
router.POST("/api/exercices/:eid/tags", apiHandler(exerciceHandler(addExerciceTag)))
router.PUT("/api/exercices/:eid/tags", apiHandler(exerciceHandler(updateExerciceTags)))
// Remote
router.GET("/api/remote/themes/:thid/exercices/:exid", apiHandler(sync.ApiGetRemoteExercice))
router.GET("/api/remote/themes/:thid/exercices/:exid/hints", apiHandler(sync.ApiGetRemoteExerciceHints))
router.GET("/api/remote/themes/:thid/exercices/:exid/flags", apiHandler(sync.ApiGetRemoteExerciceFlags))
// Synchronize
router.POST("/api/sync/themes/:thid/exercices/:eid", apiHandler(themedExerciceHandler(
func(theme fic.Theme, exercice fic.Exercice, _ []byte) (interface{}, error) {