I have a handler / controller that takes in an http request.
func UpdateHandler(request *http.Request) {
ID := mux.Vars(request)["ID"]
UpdateForm.Save(ID,db)
}
Then I have a form that I want to process the data and eventually update it.
type UpdateForm struct {
ID string `json:"type"`
}
func (UpdateForm) Save(db mongo.Database) {
id := ID
repository.Update(Id)
}
Go will print out undefined ID
How can I make sure that the form gets the value from the controller?