From 7b436bba242b710071b225c0a69c31f09e2f6161 Mon Sep 17 00:00:00 2001 From: jakehobbs Date: Fri, 21 Jun 2024 12:43:31 -0700 Subject: [PATCH] fix external events (#212) --- server/src/main.go | 6 +++--- server/src/model/external_events.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/main.go b/server/src/main.go index 7f5c8c2..af5cb54 100644 --- a/server/src/main.go +++ b/server/src/main.go @@ -1642,8 +1642,8 @@ func (c MainController) UsersRolesRemoveHandler(w http.ResponseWriter, r *http.R func (c MainController) AdminFeatureEventHandler(w http.ResponseWriter, r *http.Request) { var eventData struct { - ID int `json:"id"` - Featured bool `json:"featured"` + ID string `json:"id"` + Featured bool `json:"featured"` } err := json.NewDecoder(r.Body).Decode(&eventData) @@ -1665,7 +1665,7 @@ func (c MainController) AdminFeatureEventHandler(w http.ResponseWriter, r *http. func (c MainController) AdminCancelEventHandler(w http.ResponseWriter, r *http.Request) { var eventData struct { - ID int `json:"id"` + ID string `json:"id"` } err := json.NewDecoder(r.Body).Decode(&eventData) diff --git a/server/src/model/external_events.go b/server/src/model/external_events.go index 8b78f96..6c6a4b4 100644 --- a/server/src/model/external_events.go +++ b/server/src/model/external_events.go @@ -113,7 +113,7 @@ func AddEventbriteDetailsToEventByID(db *sqlx.DB, event ExternalEvent) error { return nil } -func FeatureExternalEvent(db *sqlx.DB, eventId int, featured bool) error { +func FeatureExternalEvent(db *sqlx.DB, eventId string, featured bool) error { _, err := db.Exec(`UPDATE fb_events SET featured = ? WHERE id = ?`, featured, eventId) @@ -123,7 +123,7 @@ func FeatureExternalEvent(db *sqlx.DB, eventId int, featured bool) error { return nil } -func CancelExternalEvent(db *sqlx.DB, eventId int) error { +func CancelExternalEvent(db *sqlx.DB, eventId string) error { _, err := db.Exec(`UPDATE fb_events SET is_canceled = 1 WHERE id = ?`, eventId)