tag-registry-product-link: seed 100 real preset IDs (seed-registry cmd), products/orders schema + tag linkage, fix case-sensitive tag-code bind

This commit is contained in:
2026-08-07 16:56:50 +10:00
parent 24c7728559
commit e3bcd2e6e0
9 changed files with 159 additions and 19 deletions

View File

@@ -37,7 +37,8 @@ func (a *App) Account(w http.ResponseWriter, r *http.Request) {
// AddTag binds a tag code to the current account (HTMX: returns account-panel).
func (a *App) AddTag(w http.ResponseWriter, r *http.Request) {
uid, _ := auth.GetUserID(r)
code := strings.ToUpper(strings.TrimSpace(r.FormValue("tag_code")))
// Tag codes are case-sensitive (preset base64 IDs) — trim only, never normalise case.
code := strings.TrimSpace(r.FormValue("tag_code"))
oid := ownerID(uid)
data := accountData{}