fuck. list expiries + accept post form expiry

This commit is contained in:
2026-11-10 22:26:08 -05:00
parent 9bda8bc93d
commit 1b636ef51a
3 changed files with 14 additions and 7 deletions
+4 -2
View File
@@ -23,8 +23,7 @@ import (
)
type HomePageData struct {
Title string
Description string
Expiries []Expiry
}
func health(w http.ResponseWriter, r *http.Request) {
@@ -71,6 +70,9 @@ func uploadHandler(db *gorm.DB, cfg Config) http.HandlerFunc {
}
expLabel := r.URL.Query().Get("expiry")
if expLabel == "" {
expLabel = r.PostFormValue("expiry") // html form request
}
if expLabel == "" {
expLabel = cfg.Expiries[0].Label
}