admin: Add /exercices pages to get all exercices of a theme
This commit is contained in:
parent
c9e4d3e27c
commit
ad6199269b
1 changed files with 9 additions and 1 deletions
|
@ -84,7 +84,15 @@ func listTheme(args []string, body []byte) (interface{}, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if len(args) == 2 {
|
} else if len(args) == 2 {
|
||||||
|
if args[1] == "exercices" {
|
||||||
|
if theme, err := getTheme(args); err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else {
|
||||||
|
return theme.GetExercices()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return getExercice(args)
|
return getExercice(args)
|
||||||
|
}
|
||||||
} else if len(args) == 1 {
|
} else if len(args) == 1 {
|
||||||
if args[0] == "themes.json" {
|
if args[0] == "themes.json" {
|
||||||
return exportThemes()
|
return exportThemes()
|
||||||
|
|
Reference in a new issue