|
|
@ -183,12 +183,24 @@ func updateTypHandler(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 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var typ Typ |
|
|
|
|
|
|
|
if req.Form["bezeichnung"] != nil { |
|
|
|
|
|
|
|
typ.Bezeichnung = req.FormValue("bezeichnung") |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
body, err := io.ReadAll(req.Body) |
|
|
|
body, err := io.ReadAll(req.Body) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
writer.WriteHeader(http.StatusBadRequest) |
|
|
|
writer.WriteHeader(http.StatusBadRequest) |
|
|
|
} |
|
|
|
} |
|
|
|
var typ Typ |
|
|
|
var typ Typ |
|
|
|
json.Unmarshal(body, &typ) |
|
|
|
json.Unmarshal(body, &typ) |
|
|
|
|
|
|
|
} |
|
|
|
log.Println("Name = ", typ.Bezeichnung) |
|
|
|
log.Println("Name = ", typ.Bezeichnung) |
|
|
|
log.Info("updating Typ", typ.Bezeichnung) |
|
|
|
log.Info("updating Typ", typ.Bezeichnung) |
|
|
|
res, err := UpdateTyp(typ) |
|
|
|
res, err := UpdateTyp(typ) |
|
|
|