1
0

Implemented team update method

This commit is contained in:
konrad
2018-07-14 18:29:24 +02:00
committed by kolaente
parent bcbd415529
commit 4cf0cd233c
9 changed files with 96 additions and 10 deletions

View File

@ -7,14 +7,16 @@ func (t *Team) Create(doer *User, _ int64) (err error) {
return ErrTeamNameCannotBeEmpty{}
}
// Set the id to 0, otherwise the creation fails because of double keys
t.CreatedByID = doer.ID
t.CreatedBy = doer
t.CreatedBy = *doer
_, err = x.Insert(t)
if err != nil {
return
}
// Insert the current user as member and admin
tm := TeamMember{TeamID: t.ID, UserID: doer.ID, IsAdmin: true}
err = tm.Create(doer, t.ID)
return
}