You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2018/07/13 01:46:12 UTC
[trafficcontrol] 02/03: overwrite any key value provided in params
This is an automated email from the ASF dual-hosted git repository.
mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit d05368fde3a7aba79ab87345ae8f5602bf009fed
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Mon Jul 9 13:47:07 2018 -0600
overwrite any key value provided in params
---
traffic_ops/traffic_ops_golang/api/shared_handlers.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/api/shared_handlers.go b/traffic_ops/traffic_ops_golang/api/shared_handlers.go
index abcf0c2..68ede49 100644
--- a/traffic_ops/traffic_ops_golang/api/shared_handlers.go
+++ b/traffic_ops/traffic_ops_golang/api/shared_handlers.go
@@ -270,8 +270,8 @@ func UpdateHandler(typeFactory CRUDFactory) http.HandlerFunc {
return
}
- if kf.Field == "id" && paramValue != "" {
- // ignore id provided in JSON -- overwrite with paramValue
+ if paramValue != "" {
+ // if key's value provided in params, overwrite it and ignore that provided in JSON
keys[kf.Field] = paramValue
u.SetKeys(keys)
continue