srijeet0406 commented on a change in pull request #4942:
URL: https://github.com/apache/trafficcontrol/pull/4942#discussion_r468762324
##########
File path: traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
##########
@@ -567,6 +582,22 @@ func (cg *TOCacheGroup) Update() (error, error, int) {
return nil, nil, http.StatusOK
}
+func CheckIfExistsBeforeUpdate(tx *sqlx.Tx, cgID int) (error, *tc.TimeNoMod) {
Review comment:
I have refactored it so that all the places that are NOT part of the
CRUDer interfaces, call the common function in the `api` package, by passing in
the table name like you suggested.
For the `GenericUpdate` occurrences, we need it to be specific to each
component, because we dont know what "type" is calling the function. Hence,
each component that implements the CRUDer interface, has its own implementation
of the above function.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]