Browse Source

fix wdm.go

pull/1/head
Georg Spar 1 year ago
parent
commit
c00517f745
  1. 12
      wdm.go

12
wdm.go

@ -799,9 +799,9 @@ func deleteItemExtHandler(writer http.ResponseWriter, req *http.Request) {
writer.WriteHeader(http.StatusBadRequest)
return
}
itemBId, _ := strconv.ParseUint(mux.Vars(req)["id"], 10, 0)
log.Info("Deleting Typ with ID", itemBId)
_, err = DeleteItemB(uint64(itemBId))
itemExtId, _ := strconv.ParseUint(mux.Vars(req)["id"], 10, 0)
log.Info("Deleting Typ with ID", itemExtId)
_, err = DeleteItemExt(uint64(itemExtId))
if err != nil {
log.Fatal("Error: Delete could not be executed", err)
}
@ -813,7 +813,7 @@ func showItemExtHandler(writer http.ResponseWriter, req *http.Request) {
if req.Method == http.MethodOptions {
return
}
res, err := ShowItemB()
res, err := ShowItemExt()
if err != nil {
log.Fatal("Error: Typ can't be shown ", err)
writer.WriteHeader(http.StatusInternalServerError)
@ -883,8 +883,8 @@ func updateItemExtHandler(writer http.ResponseWriter, req *http.Request) {
if err != nil {
writer.WriteHeader(http.StatusBadRequest)
}
var itemB Itemb
json.Unmarshal(body, &itemB)
var itemExt ItemExt
json.Unmarshal(body, &itemExt)
}
log.Println("ID = ", itemExt.Id)

Loading…
Cancel
Save