Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
fix: fix panic when missing categories
Browse files Browse the repository at this point in the history
  • Loading branch information
eze-kiel committed Jun 3, 2022
1 parent e4fbee2 commit df4cc52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ func (a App) newProcess(c *gin.Context) {
Link string `form:"link"`
Category string `form:"category"`

Cities []string
Cities []string
Categories []string
}
var p page

Expand Down Expand Up @@ -746,6 +747,7 @@ func (a App) newProcess(c *gin.Context) {
log.Errorf("cannot send create payload via notifier: %s", err)
}
p.Cities = utils.AllCities
p.Categories = utils.RemoveFromSliceOrdered(events.Categories, p.Category)
c.HTML(http.StatusOK, "new.html", p)
}

Expand Down

0 comments on commit df4cc52

Please sign in to comment.