refactor: update AS entry handling in API and database to support ASN-only entries. Remove prefix field from AS entry structure and adjust related functions and tests. Enhance OpenAPI specifications and documentation to reflect changes in AS entry representation.
This commit is contained in:
@@ -231,17 +231,7 @@ func (s *Server) handleListAS(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func asEntryJSON(x *store.ASEntry) map[string]any {
|
||||
m := map[string]any{"id": x.ID}
|
||||
if x.ASN != nil {
|
||||
m["asn"] = *x.ASN
|
||||
} else {
|
||||
m["asn"] = nil
|
||||
}
|
||||
if x.Prefix != nil {
|
||||
m["prefix"] = *x.Prefix
|
||||
} else {
|
||||
m["prefix"] = nil
|
||||
}
|
||||
m := map[string]any{"id": x.ID, "asn": x.ASN}
|
||||
if x.CommunityID != nil {
|
||||
m["community_id"] = *x.CommunityID
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user