Files
MiauInv/handlers/locations.go
2026-06-03 14:24:14 +02:00

21 lines
301 B
Go

package handlers
import (
"MiauInv/storage"
"net/http"
)
func CreateLocation(w http.ResponseWriter, r *http.Request) {
name := r.FormValue("name")
_, err := storage.DB.Exec(
"INSERT INTO locations(name) VALUES(?)",
name,
)
if err != nil {
http.Error(w, err.Error(), 500)
return
}
}