Commit a777c4c
Eric Bower
·
2026-03-10 22:17:39 -0400 EDT
parent 3aa3b80
chore(pgs): require pico+ for auto-forms
1 files changed,
+7,
-0
+7,
-0
| ... | ... | @@ -44,6 +44,13 @@ func handleAutoForm(w http.ResponseWriter, r *http.Request, cfg *PgsConfig) { | |
| 44 | 44 | return | |
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | + | ff, err := cfg.DB.FindFeature(user.ID, "plus") | |
| 48 | + | if err != nil || (ff != nil && !ff.IsValid()) { | |
| 49 | + | cfg.Logger.Error("pico+ required for auto-forms", "username", props.Username) | |
| 50 | + | http.Error(w, "pico+ required for auto-forms", http.StatusPaymentRequired) | |
| 51 | + | return | |
| 52 | + | } | |
| 53 | + | ||
| 47 | 54 | err = cfg.DB.InsertFormEntry(user.ID, formName, formValues) | |
| 48 | 55 | if err != nil { | |
| 49 | 56 | cfg.Logger.Error("failed to save form data", "err", err) |