Add admin location editing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+18
@@ -578,6 +578,24 @@ func (s *Server) handleUpdateDescription(w http.ResponseWriter, r *http.Request)
|
||||
http.Redirect(w, r, fmt.Sprintf("/e/%s/admin/%s", event.Slug, event.AdminToken), http.StatusSeeOther)
|
||||
}
|
||||
|
||||
func (s *Server) handleUpdateLocation(w http.ResponseWriter, r *http.Request) {
|
||||
event := s.authorizeAdmin(w, r, false)
|
||||
if event == nil {
|
||||
return
|
||||
}
|
||||
|
||||
r.Body = http.MaxBytesReader(w, r.Body, 8*1024)
|
||||
r.ParseForm()
|
||||
location := sanitize(r.FormValue("location"), maxFieldLen)
|
||||
|
||||
s.q.UpdateEventLocation(r.Context(), db.UpdateEventLocationParams{
|
||||
Location: location,
|
||||
ID: event.ID,
|
||||
})
|
||||
|
||||
http.Redirect(w, r, fmt.Sprintf("/e/%s/admin/%s", event.Slug, event.AdminToken), http.StatusSeeOther)
|
||||
}
|
||||
|
||||
func (s *Server) handleCreateSlot(w http.ResponseWriter, r *http.Request) {
|
||||
event := s.authorizeAdmin(w, r, false)
|
||||
if event == nil {
|
||||
|
||||
Reference in New Issue
Block a user