when ID = 0 is passed to a 'GetSthByID'-function, it now returns a 'not exist' error
This commit is contained in:
@ -62,6 +62,10 @@ type TeamUser struct {
|
||||
|
||||
// GetTeamByID gets a team by its ID
|
||||
func GetTeamByID(id int64) (team Team, err error) {
|
||||
if id < 1 {
|
||||
return team, ErrTeamDoesNotExist{id}
|
||||
}
|
||||
|
||||
exists, err := x.Where("id = ?", id).Get(&team)
|
||||
if err != nil {
|
||||
return
|
||||
|
Reference in New Issue
Block a user