fixed item box update

This commit is contained in:
Steve White 2024-10-14 23:55:23 -05:00
parent ea4c6142d0
commit d3c97555e4
2 changed files with 2 additions and 2 deletions

View File

@ -331,7 +331,7 @@ func UpdateItemHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Invalid request body", http.StatusBadRequest)
return
}
fmt.Println(item)
db.Save(&item)
json.NewEncoder(w).Encode(item)
}

View File

@ -67,7 +67,7 @@ func main() {
// Apply CORS middleware
c := cors.New(cors.Options{
AllowedOrigins: []string{"http://localhost:3000"}, // Change this to your frontend domain
AllowedOrigins: []string{"http://localhost:3000", "http://10.0.0.16:3000"}, // Change this to your frontend domain
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowedHeaders: []string{"Authorization", "Content-Type"},
AllowCredentials: true,