Skip to content
Snippets Groups Projects
Commit 8b026704 authored by Johannes Borgen's avatar Johannes Borgen
Browse files

Merge branch 'dev' of git.gvk.idi.ntnu.no:jobnb/cloudproject into dev

parents 1263666f c84c00a2
No related branches found
No related tags found
1 merge request!4Finished app
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/http" "net/http"
"strings"
) )
type Review struct { type Review struct {
...@@ -53,7 +54,13 @@ func ReviewHandler(w http.ResponseWriter, r *http.Request) { ...@@ -53,7 +54,13 @@ func ReviewHandler(w http.ResponseWriter, r *http.Request) {
} }
} }
case http.MethodDelete: case http.MethodDelete:
var parts = make([]string, 6)
parts = strings.Split(r.URL.Path, "/")
err := DB.DeleteByTurID(parts[4])
if err != nil {
fmt.Println("error: deleting object", err)
}
default: http.Error(w, "Invalid method " + r.Method, http.StatusBadRequest) default: http.Error(w, "Invalid method " + r.Method, http.StatusBadRequest)
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment