From 07767a0a0c0a1e3e3c302b89a8e8a98c6341bfcc Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Sun, 7 Aug 2016 16:05:57 +0530 Subject: [PATCH] Bug fixes for hidden task --- db/tasks.go | 4 ++-- templates/edit.html | 2 +- views/api.go | 10 +++++++++- views/otherViews.go | 11 ++++++++++- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/db/tasks.go b/db/tasks.go index c038c8e..3126f72 100644 --- a/db/tasks.go +++ b/db/tasks.go @@ -152,7 +152,7 @@ func GetTaskByID(username string, id int) (types.Context, error) { var tasks []types.Task var task types.Task - getTaskSQL := "select t.id, t.title, t.content, t.priority, t.hide, 'UNCATEGORIZED' from task t join user u where t.user_id=u.id and t.cat_id=0 union select t.id, t.title, t.content, t.priority, c.name from task t join user u left outer join category c where c.id = t.cat_id and t.user_id=u.id and t.id=? and u.username=?;" + getTaskSQL := "select t.id, t.title, t.content, t.priority, t.hide, 'UNCATEGORIZED' from task t join user u where t.user_id=u.id and t.cat_id=0 union select t.id, t.title, t.content, t.priority, t.hide, c.name from task t join user u left outer join category c where c.id = t.cat_id and t.user_id=u.id and t.id=? and u.username=?;" rows := database.query(getTaskSQL, id, username) defer rows.Close() @@ -250,7 +250,7 @@ func GetCategoryIDByName(username string, category string) int { } //UpdateTask is used to update the tasks in the database -func UpdateTask(id int, title, content, category string, priority int, username string) error { +func UpdateTask(id int, title, content, category string, priority int, username string, hidden int) error { categoryID := GetCategoryIDByName(username, category) userID, err := GetUserID(username) if err != nil { diff --git a/templates/edit.html b/templates/edit.html index e4ea9ea..16924c2 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -18,7 +18,7 @@ Medium Low - Hide from timeline + Hide from timeline
Category: