Implement and display headlines in interface
This commit is contained in:
parent
abd7fc6bef
commit
8c95782eff
13 changed files with 85 additions and 58 deletions
|
@ -146,15 +146,8 @@ func showThemedExercice(theme fic.Theme, exercice fic.Exercice, body []byte) (in
|
|||
return exercice, nil
|
||||
}
|
||||
|
||||
type uploadedTheme struct {
|
||||
Name string
|
||||
URLId string
|
||||
Authors string
|
||||
Intro string
|
||||
}
|
||||
|
||||
func createTheme(_ httprouter.Params, body []byte) (interface{}, error) {
|
||||
var ut uploadedTheme
|
||||
var ut fic.Theme
|
||||
if err := json.Unmarshal(body, &ut); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -163,7 +156,7 @@ func createTheme(_ httprouter.Params, body []byte) (interface{}, error) {
|
|||
return nil, errors.New("Theme's name not filled")
|
||||
}
|
||||
|
||||
return fic.CreateTheme(ut.Name, ut.URLId, "", ut.Authors, ut.Intro, "")
|
||||
return fic.CreateTheme(ut.Name, ut.URLId, "", ut.Authors, ut.Intro, ut.Headline, ut.Image)
|
||||
}
|
||||
|
||||
func updateTheme(theme fic.Theme, body []byte) (interface{}, error) {
|
||||
|
|
Reference in a new issue