Browse Source

API: multipart-form DELETE

pull/1/head
Georg Spar 1 year ago
parent
commit
052a2f5089
  1. 7
      wdm.go

7
wdm.go

@ -116,9 +116,14 @@ func deleteTypHandler(writer http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodOptions { if req.Method == http.MethodOptions {
return return
} }
err := req.ParseMultipartForm(64 << 20)
if err != nil {
writer.WriteHeader(http.StatusBadRequest)
return
}
typId, _ := strconv.ParseUint(mux.Vars(req)["id"], 10, 0) typId, _ := strconv.ParseUint(mux.Vars(req)["id"], 10, 0)
log.Info("Deleting Instance with ID", typId) log.Info("Deleting Instance with ID", typId)
_, err := DeleteTyp(uint(typId)) _, err = DeleteTyp(uint(typId))
if err != nil { if err != nil {
log.Fatal("Error: Delete could not be executed", err) log.Fatal("Error: Delete could not be executed", err)
} }

Loading…
Cancel
Save