fixed item box update
This commit is contained in:
parent
ea4c6142d0
commit
d3c97555e4
|
@ -331,7 +331,7 @@ func UpdateItemHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, "Invalid request body", http.StatusBadRequest)
|
http.Error(w, "Invalid request body", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
fmt.Println(item)
|
||||||
db.Save(&item)
|
db.Save(&item)
|
||||||
json.NewEncoder(w).Encode(item)
|
json.NewEncoder(w).Encode(item)
|
||||||
}
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -67,7 +67,7 @@ func main() {
|
||||||
|
|
||||||
// Apply CORS middleware
|
// Apply CORS middleware
|
||||||
c := cors.New(cors.Options{
|
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"},
|
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
|
||||||
AllowedHeaders: []string{"Authorization", "Content-Type"},
|
AllowedHeaders: []string{"Authorization", "Content-Type"},
|
||||||
AllowCredentials: true,
|
AllowCredentials: true,
|
||||||
|
|
Loading…
Reference in New Issue