Merge exercices API routes

This commit is contained in:
nemunaire 2016-12-26 01:14:46 +01:00 committed by Pierre-Olivier Mercier
commit 5111143d2a
4 changed files with 57 additions and 102 deletions

View file

@ -78,7 +78,7 @@ func (t Theme) GetExercices() ([]Exercice, error) {
}
}
func (t Theme) AddExercice(title string, statement string, depend *Exercice, gain int, videoURI string) (Exercice, error) {
func (t Theme) AddExercice(title string, statement string, depend *Exercice, gain int64, videoURI string) (Exercice, error) {
var dpd interface{}
if depend == nil {
dpd = nil
@ -91,9 +91,9 @@ func (t Theme) AddExercice(title string, statement string, depend *Exercice, gai
return Exercice{}, err
} else {
if depend == nil {
return Exercice{eid, title, statement, nil, int64(gain), videoURI}, nil
return Exercice{eid, title, statement, nil, gain, videoURI}, nil
} else {
return Exercice{eid, title, statement, &depend.Id, int64(gain), videoURI}, nil
return Exercice{eid, title, statement, &depend.Id, gain, videoURI}, nil
}
}
}