CRUD Events and React interaction
This commit is contained in:
@@ -22,7 +22,7 @@ func HandleUpdateEvent(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
event_uuid := r.PathValue("event_uuid")
|
||||
event.EventID, err = uuid.FromBytes([]byte(event_uuid))
|
||||
event.EventID, err = uuid.Parse(event_uuid)
|
||||
if err != nil {
|
||||
core.JSONError{
|
||||
Status: core.Error,
|
||||
@@ -44,7 +44,7 @@ func HandleUpdateEvent(w http.ResponseWriter, r *http.Request) {
|
||||
// }
|
||||
|
||||
_, err = core.DB.NewUpdate().
|
||||
Model(event).
|
||||
Model(&event).
|
||||
OmitZero().
|
||||
WherePK().
|
||||
Exec(context.Background())
|
||||
@@ -62,4 +62,3 @@ func HandleUpdateEvent(w http.ResponseWriter, r *http.Request) {
|
||||
Data: event,
|
||||
}.Respond(w, http.StatusOK)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user