Code cleanup

pull/1188/head
supermazena 5 years ago committed by Alex Baker
parent d4f3438eed
commit dc615b6c51

@ -68,12 +68,14 @@ class TaskDuplicator @Inject constructor(
} }
gcalHelper.createTaskEventIfEnabled(clone) gcalHelper.createTaskEventIfEnabled(clone)
taskDao.save(clone, null) // TODO: delete me taskDao.save(clone, null) // TODO: delete me
getDirectChildren(originalId) getDirectChildren(originalId).forEach { subtask ->
.filter { it.parent == originalId } clone(subtask, newId)
.forEach { subtask -> clone(subtask, newId) } }
return clone return clone
} }
private suspend fun getDirectChildren(taskId: Long): List<Task> = private suspend fun getDirectChildren(taskId: Long): List<Task> =
taskDao.fetch(taskDao.getChildren(taskId)).filter { it.parent == taskId } taskDao
.fetch(taskDao.getChildren(taskId))
.filter { it.parent == taskId }
} }
Loading…
Cancel
Save