CRUD Events and React interaction
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user