1
0

Renamed list items to tasks

This commit is contained in:
konrad
2018-08-30 08:09:17 +02:00
committed by kolaente
parent d5758e0444
commit d31f16aff1
18 changed files with 249 additions and 249 deletions

View File

@ -15,18 +15,18 @@ func (n *Namespace) Delete() (err error) {
return
}
// Delete all lists with their items
// Delete all lists with their tasks
lists, err := GetListsByNamespaceID(n.ID)
var listIDs []int64
// We need to do that for here because we need the list ids to delete two times:
// 1) to delete the lists itself
// 2) to delete the list items
// 2) to delete the list tasks
for _, list := range lists {
listIDs = append(listIDs, list.ID)
}
// Delete items
_, err = x.In("list_id", listIDs).Delete(&ListItem{})
// Delete tasks
_, err = x.In("list_id", listIDs).Delete(&ListTask{})
if err != nil {
return
}