aboutsummaryrefslogtreecommitdiffstats
path: root/todolist
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-20 22:06:05 +0800
committerQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2017-08-20 22:06:05 +0800
commit7bd6749e7fdfbc636b15cb18d89081eb78f870a8 (patch)
tree667394a3206f58c65c6a2d0be7503a5d65ea2bcb /todolist
parent387d92060c04998fa8a723f2eba814469bc39d57 (diff)
Fix out-of-date usage according to internal API changes
Since the getId() function has been changed, the call in ManipulateNotes() is fixed in this patch.
Diffstat (limited to 'todolist')
-rw-r--r--todolist/app.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/todolist/app.go b/todolist/app.go
index 96da67f..66b30c8 100644
--- a/todolist/app.go
+++ b/todolist/app.go
@@ -139,9 +139,11 @@ func (a *App) ExpandTodo(input string) {
func (a *App) ManipulateNotes(input string) {
a.Load()
- id, todo := a.getId(input)
+ id := a.getId(input)
parser := &Parser{}
- if id == -1 {
+ todo := a.TodoList.FindById(id)
+ if todo == nil {
+ fmt.Println("No such id.")
return
}