Let admins edit event date and time

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 17:21:01 -04:00
parent 1f0effb902
commit 891b49b4c0
6 changed files with 78 additions and 0 deletions
+20
View File
@@ -707,6 +707,26 @@ func (s *Server) handleUpdateLocation(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) handleUpdateDateTime(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()
date := sanitize(r.FormValue("date"), maxFieldLen)
time_ := sanitize(r.FormValue("time"), maxFieldLen)
s.q.UpdateEventDateTime(r.Context(), db.UpdateEventDateTimeParams{
Date: date,
Time: time_,
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 {