Bug Fix: Category case is normalized

This commit is contained in:
Gabe Farrell 2023-04-15 14:05:10 -04:00
parent 8cbb8ee963
commit 6c55e37f20
2 changed files with 6 additions and 4 deletions

View file

@ -6,6 +6,7 @@ import (
"fmt"
"net/http"
"strconv"
"strings"
"github.com/jacobmveber-01839764/BudgetBuddy/db"
"github.com/jacobmveber-01839764/BudgetBuddy/money"
@ -94,7 +95,7 @@ func SetCategoryBudget(w http.ResponseWriter, r *http.Request) {
// get form values
r.ParseForm()
cat := r.FormValue("category")
cat := strings.ToLower(r.FormValue("category"))
if cat == "" {
w.WriteHeader(http.StatusBadRequest)
fmt.Fprintf(w, "{\"error\":\"category must be specified\"}")