fuck. list expiries + accept post form expiry
This commit is contained in:
+4
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user