Skip to content

Commit

Permalink
fix external events (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakehobbs authored Jun 21, 2024
1 parent 81fab1a commit 7b436bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions server/src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions server/src/model/external_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 7b436bb

Please sign in to comment.