1
0

implemented binding url params directly to struct instead of passing them to the method for deleting items

This commit is contained in:
konrad
2018-07-18 08:15:38 +02:00
committed by kolaente
parent f0c003d069
commit 249128a46e
17 changed files with 48 additions and 40 deletions

View File

@ -1,14 +1,14 @@
package models
// Delete implements the delete method for listItem
func (i *ListItem) Delete(id int64) (err error) {
func (i *ListItem) Delete() (err error) {
// Check if it exists
_, err = GetListItemByID(id)
_, err = GetListItemByID(i.ID)
if err != nil {
return
}
_, err = x.ID(id).Delete(ListItem{})
_, err = x.ID(i.ID).Delete(ListItem{})
return
}