libfic: split team removal in two requests
This commit is contained in:
parent
510e25e351
commit
17d983221d
1 changed files with 3 additions and 1 deletions
|
@ -82,7 +82,9 @@ func (t Team) Update() (int64, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t Team) Delete() (int64, error) {
|
func (t Team) Delete() (int64, error) {
|
||||||
if res, err := DBExec("DELETE FROM team_members WHERE id_team = ?; DELETE FROM teams WHERE id_team = ?", t.Id, t.Id); err != nil {
|
if _, err := DBExec("DELETE FROM team_members WHERE id_team = ?", t.Id); err != nil {
|
||||||
|
return 0, err
|
||||||
|
} else if res, err := DBExec("DELETE FROM teams WHERE id_team = ?", t.Id); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
} else if nb, err := res.RowsAffected(); err != nil {
|
} else if nb, err := res.RowsAffected(); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|
Reference in a new issue