about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-19 23:15:58 +0200
committerEmile <hanemile@protonmail.com>2019-10-19 23:15:58 +0200
commita03aec45993ecf708a5b0401ad87b78902327424 (patch)
treea973b9945af487a06c6e334f972d3953f0ee8e48 /src
parent8bd955855974f1ed5e4038dae76b77d77ac89061 (diff)
using the dbGetChallengeByUUID function
Diffstat (limited to 'src')
-rw-r--r--src/http.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/http.go b/src/http.go
index 7be863d..d39b879 100644
--- a/src/http.go
+++ b/src/http.go
@@ -129,24 +129,14 @@ func editGetHandler(w http.ResponseWriter, r *http.Request) {
 
 	log.Printf("fetching challenge with the uuid %s", uuid)
 
-	//chall := dbGetChallengeByUUID(uuid)
-	//
-	// temporary test challenge used while the dbGetChallengeByUUID function
-	// has not been implemented:
-	chall := Challenge{
-		UUID:        uuid,
-		Name:        "random challenge name",
-		Description: "some bad description",
-		Flag:        "FLAG",
-		Container:   "container-randomchallenge",
-		Category:    "guess",
-		Points:      100,
-		Static:      false,
+	chall, err := dbGetChallengeByUUID(uuid)
+	if err != nil {
+		log.Println(err)
 	}
 
 	// define a new template to render the challenges in
 	t := template.New("")
-	t, err := t.ParseFiles("./hosted/edit_uuid.html")
+	t, err = t.ParseFiles("./hosted/edit_uuid.html")
 	if err != nil {
 		log.Println(err)
 		return