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
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -477,7 +477,17 @@ func (l *List) Create(a web.Auth) (err error) {
l.Owner = doer l.Owner = doer
l.ID = 0 // Otherwise only the first time a new list would be created 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 // Delete implements the delete method of CRUDable