gbkannan89 commented on code in PR #7733: URL: https://github.com/apache/trafficcontrol/pull/7733#discussion_r1307303610
########## traffic_ops/traffic_ops_golang/origin/origins.go: ########## @@ -487,3 +488,217 @@ func deleteQuery() string { WHERE id=:id` return query } + +// Get is the handler for GET requests to Origins of APIv5 +func Get(w http.ResponseWriter, r *http.Request) { + + var useIMS bool + + inf, sysErr, userErr, errCode := api.NewInfo(r, nil, nil) + if sysErr != nil || userErr != nil { + api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, sysErr) + return + } + defer inf.Close() + + origins, userErr, sysErr, errCode, maxTime := getOrigins(w.Header(), inf.Params, inf.Tx, inf.User, useIMS) + var returnable []tc.OriginV5 Review Comment: You don't need to do anything here if there are no origins, the response will be an empty array by default -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@trafficcontrol.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org