Added check if the namespace exists when creating a list
This commit is contained in:
parent
6eeab7fe10
commit
c97a4d74cb
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,12 @@ func CreateOrUpdateList(list *List) (err error) {
|
|||
return ErrListTitleCannotBeEmpty{}
|
||||
}
|
||||
|
||||
// Check if the namespace exists
|
||||
_, err = GetNamespaceByID(list.NamespaceID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if list.ID == 0 {
|
||||
_, err = x.Insert(list)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue