Add creating a new first bucket when creating a new list

This commit is contained in:
kolaente 2020-04-26 15:51:59 +02:00
parent f0cb3b5e36
commit 5606f987fa
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 1 deletions

View File

@ -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