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

Loading…
Cancel
Save