From b84c2d1ec6acb70f76a03010b1fdc868cf3d485e Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 10 Nov 2019 17:49:41 -0500 Subject: Add Todos --- backend/main.go | 5 ++++- backend/todo.txt | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 backend/todo.txt diff --git a/backend/main.go b/backend/main.go index fc7317f..b4cd76f 100644 --- a/backend/main.go +++ b/backend/main.go @@ -121,7 +121,7 @@ func RecipeList(w http.ResponseWriter, r *http.Request) { } } - + //TODO add generic error response } func SingleRecipe(w http.ResponseWriter, r *http.Request) { @@ -160,7 +160,9 @@ func SingleRecipe(w http.ResponseWriter, r *http.Request) { } else if r.Method == "POST" { fmt.Printf("Create recipe \"%d\"...\n", recipe_id) + //TODO add error msg response } else if r.Method == "PUT" { + //TODO add Update Recipe fmt.Printf("Update recipe \"%d\"...\n", recipe_id) } else if r.Method == "DELETE" { res, err := db.Exec(`DELETE FROM recipes where id = $1`, @@ -192,6 +194,7 @@ func SingleRecipe(w http.ResponseWriter, r *http.Request) { } } + //TODO add generic error response } var DB_PASSWORD string diff --git a/backend/todo.txt b/backend/todo.txt new file mode 100644 index 0000000..3c911c4 --- /dev/null +++ b/backend/todo.txt @@ -0,0 +1,2 @@ +Add Update method for recipes +Add Error responses for incorrect methods -- cgit v1.1