1
0

implemented readone with parambinder

This commit is contained in:
konrad
2018-07-21 15:08:46 +02:00
committed by kolaente
parent d06ed68125
commit 9e75e9b73b
9 changed files with 44 additions and 42 deletions

View File

@ -2,7 +2,7 @@ package models
// Team holds a team object
type Team struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"teamid"`
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"team"`
Name string `xorm:"varchar(250) not null" json:"name"`
Description string `xorm:"varchar(250)" json:"description"`
CreatedByID int64 `xorm:"int(11) not null" json:"-"`
@ -100,8 +100,8 @@ func GetTeamByID(id int64) (team Team, err error) {
}
// ReadOne implements the CRUD method to get one team
func (t *Team) ReadOne(id int64) (err error) {
*t, err = GetTeamByID(id)
func (t *Team) ReadOne() (err error) {
*t, err = GetTeamByID(t.ID)
return
}