Fix removing the last bucket
This commit is contained in:
parent
231dc3913f
commit
f0cb3b5e36
1 changed files with 6 additions and 3 deletions
|
@ -205,6 +205,12 @@ func (b *Bucket) Delete() (err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the bucket itself
|
||||||
|
_, err = x.Where("id = ?", b.ID).Delete(&Bucket{})
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Get the default bucket
|
// Get the default bucket
|
||||||
defaultBucket, err := getDefaultBucket(b.ListID)
|
defaultBucket, err := getDefaultBucket(b.ListID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -216,8 +222,5 @@ func (b *Bucket) Delete() (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the bucket itself
|
|
||||||
_, err = x.Where("id = ?", b.ID).Delete(&Bucket{})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue