mirror of
https://github.com/gabehf/BudgetBuddy.git
synced 2026-03-16 02:36:01 -07:00
Bug Fix: Category case is normalized
This commit is contained in:
parent
8cbb8ee963
commit
6c55e37f20
2 changed files with 6 additions and 4 deletions
|
|
@ -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\"}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue