From d3c97555e430bd52c0113e02ff15c26e8aca37d8 Mon Sep 17 00:00:00 2001 From: Steve White Date: Mon, 14 Oct 2024 23:55:23 -0500 Subject: [PATCH] fixed item box update --- handlers.go | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers.go b/handlers.go index c8e76ea..cc9b0c6 100644 --- a/handlers.go +++ b/handlers.go @@ -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) } diff --git a/main.go b/main.go index a8429a3..b5a9cdf 100644 --- a/main.go +++ b/main.go @@ -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,