fix(admin): validate tier-settings slots/trial input and surface save errors #154
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-111-tier-settings-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The tier-settings form extracted four i64 fields directly via Form, so non-integer input failed extraction and returned a bare Axum 422 with no inline re-render, negative values were accepted, and the save result was swallowed by
let _ = ...followed by an unconditional success redirect.TierForm now takes raw strings and each field is parsed with parse_tier_field, which requires a whole number in [0, MAX_TIER_SLOTS] for slots and [0, MAX_TRIAL_DAYS] for trial days. The page render moved into tier_settings_content so the save handler can re-render the form inline with an error_box and the submitted values on either a validation failure or an API rejection (the latter now read from the update_tier_config result instead of being discarded). The number inputs also carry min/max attributes for client-side hints, but server-side validation is authoritative.
#BUNYIP-111