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

@@ -13,7 +13,7 @@ func HandleDeleteEvent(w http.ResponseWriter, r *http.Request) {
var event core.Event
res, err := core.DB.NewDelete().
Model(&event).
Where("id = ?", uuid).
Where("event_id = ?", uuid).
Returning("*").
Exec(context.Background())
if err != nil {
@@ -24,10 +24,9 @@ func HandleDeleteEvent(w http.ResponseWriter, r *http.Request) {
return
}
log.Println(res)
core.JSONSuccess{
Status: core.Success,
Message: "Event deleted.",
}.Respond(w, http.StatusOK)
}