// GetAll updates a site using it's identifier, with the JSON payload containing name and type func (lr *SiteRouter) PutSite(params martini.Params, r *http.Request, w http.ResponseWriter, siteModel *models.SiteModel, conn redis.Conn) { var site *model.Site err := json.NewDecoder(r.Body).Decode(&site) if err != nil { WriteServerErrorResponse("Unable to parse body", http.StatusInternalServerError, w) return } err = siteModel.Update(params["id"], site, conn) if err != nil { WriteServerErrorResponse("Unable to update site", http.StatusInternalServerError, w) return } w.WriteHeader(http.StatusOK) }