2018-07-11 11:44:17 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
// Delete implements the delete method for listItem
|
2018-07-18 08:15:38 +02:00
|
|
|
func (i *ListItem) Delete() (err error) {
|
2018-07-11 11:44:17 +02:00
|
|
|
|
|
|
|
// Check if it exists
|
2018-07-18 08:15:38 +02:00
|
|
|
_, err = GetListItemByID(i.ID)
|
2018-07-11 11:44:17 +02:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-07-18 08:15:38 +02:00
|
|
|
_, err = x.ID(i.ID).Delete(ListItem{})
|
2018-07-11 11:44:17 +02:00
|
|
|
return
|
|
|
|
}
|