CRUD Events and React interaction

This commit is contained in:
cdricms
2025-01-27 17:58:47 +01:00
parent 9843158803
commit ac7e97527f
17 changed files with 887 additions and 349 deletions

View File

@@ -18,18 +18,19 @@ func HandleCreateEvent(w http.ResponseWriter, r *http.Request) {
}.Respond(w, http.StatusBadRequest)
return
}
_, err = core.DB.NewInsert().Model(&event).Exec(context.Background())
_, err = core.DB.NewInsert().Model(&event).Exec(context.Background())
if err != nil {
core.JSONError{
Status: core.Error,
Message: err.Error(),
}.Respond(w, http.StatusNotAcceptable)
}
return
}
core.JSONSuccess{
Status: core.Success,
Message: "Event created",
Data: event,
Data: event,
}.Respond(w, http.StatusCreated)
}