Skip to content

Commit

Permalink
Fixed ASN routes to produce changelog entries
Browse files Browse the repository at this point in the history
  • Loading branch information
srijeet0406 authored and rimashah25 committed Dec 20, 2023
1 parent 83556e8 commit a223c34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7814](https://github.com/apache/trafficcontrol/issues/7814) All Go components: Updated the module path to [`github.com/apache/trafficcontrol/v8`](https://pkg.go.dev/github.com/apache/trafficcontrol/v8). Module https://pkg.go.dev/github.com/apache/trafficcontrol will not receive further updates.

### Fixed
- []() *Traffic Ops* Fixed the `ASN` routes in API version 5, to produce changelog entries.
- [#7885](https://github.com/apache/trafficcontrol/pull/7885) *Traffic Portal* Fixed the issue where Compare Profiles page was not being displayed.
- [#7879](https://github.com/apache/trafficcontrol/7879) *Traffic Ops, Traffic Portal*: Fixed broken capability links for delivery service and added required capability as a column in DS table.
- [#7878](https://github.com/apache/trafficcontrol/pull/7878) *Traffic Ops, Traffic Portal*: Fixed the case where TO was failing to assign delivery services to a server, due to a bug in the way the list of preexisting delivery services was being returned.
Expand Down
6 changes: 6 additions & 0 deletions traffic_ops/traffic_ops_golang/asn/asns.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ func Create(w http.ResponseWriter, r *http.Request) {
alerts := tc.CreateAlerts(tc.SuccessLevel, "asn was created.")
w.Header().Set(rfc.Location, fmt.Sprintf("/api/%s/asns?id=%d", inf.Version, asn.ID))
api.WriteAlertsObj(w, r, http.StatusCreated, alerts, asn)
changeLogMsg := fmt.Sprintf("ASN: %d, ID:%d, ACTION: Created asn", asn.ASN, asn.ID)
api.CreateChangeLogRawTx(api.Created, changeLogMsg, inf.User, tx)
return
}

Expand Down Expand Up @@ -372,6 +374,8 @@ func Update(w http.ResponseWriter, r *http.Request) {

alerts := tc.CreateAlerts(tc.SuccessLevel, "asn was updated")
api.WriteAlertsObj(w, r, http.StatusOK, alerts, asn)
changeLogMsg := fmt.Sprintf("ASN: %d, ID:%d, ACTION: Updated asn", asn.ASN, asn.ID)
api.CreateChangeLogRawTx(api.Updated, changeLogMsg, inf.User, tx)
return
}

Expand Down Expand Up @@ -417,6 +421,8 @@ func Delete(w http.ResponseWriter, r *http.Request) {
}
alerts := tc.CreateAlerts(tc.SuccessLevel, "asn was deleted.")
api.WriteAlerts(w, r, http.StatusOK, alerts)
changeLogMsg := fmt.Sprintf("ID: %s, ACTION: Deleted asn", id)
api.CreateChangeLogRawTx(api.Deleted, changeLogMsg, inf.User, tx)
return
}

Expand Down

0 comments on commit a223c34

Please sign in to comment.