1
0

Added tests for listitems

This commit is contained in:
kolaente
2018-07-27 14:47:52 +02:00
parent 2c12797111
commit f7bc88c825
6 changed files with 92 additions and 2 deletions

View File

@ -27,6 +27,12 @@ func createOrUpdateListItem(i *ListItem, doer *User) (err error) {
return ErrListItemCannotBeEmpty{}
}
// Check if the list exists
_, err = GetListByID(i.ListID)
if err != nil {
return
}
// Do the update
if i.ID != 0 {
_, err = x.ID(i.ID).Update(i)