Add creating a new first bucket when creating a new list
This commit is contained in:
parent
f0cb3b5e36
commit
5606f987fa
1 changed files with 11 additions and 1 deletions
|
@ -477,7 +477,17 @@ func (l *List) Create(a web.Auth) (err error) {
|
|||
l.Owner = doer
|
||||
l.ID = 0 // Otherwise only the first time a new list would be created
|
||||
|
||||
return CreateOrUpdateList(l)
|
||||
err = CreateOrUpdateList(l)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Create a new first bucket for this list
|
||||
b := &Bucket{
|
||||
ListID: l.ID,
|
||||
Title: "New Bucket",
|
||||
}
|
||||
return b.Create(a)
|
||||
}
|
||||
|
||||
// Delete implements the delete method of CRUDable
|
||||
|
|
Loading…
Reference in a new issue