2018-07-11 11:44:17 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
// Delete implements the delete method for listItem
|
|
|
|
func (i *ListItem) Delete(id int64, doer *User) (err error) {
|
|
|
|
|
|
|
|
// Check if it exists
|
2018-07-12 21:20:24 +02:00
|
|
|
_, err = GetListItemByID(id)
|
2018-07-11 11:44:17 +02:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err = x.ID(id).Delete(ListItem{})
|
|
|
|
return
|
|
|
|
}
|