ocket8888 commented on code in PR #7407:
URL: https://github.com/apache/trafficcontrol/pull/7407#discussion_r1142624920


##########
experimental/traffic-portal/src/app/api/cache-group.service.ts:
##########
@@ -428,13 +429,34 @@ export class CacheGroupService extends APIService {
        }
 
        /**
-        * Deletes an existing asn.
+        * Replaces the current definition of a ASN with the one given.
         *
-        * @param asnOrId Id of the asn to delete.
-        * @returns The deleted asn.
+        * @param asn The new ASN.
+        * @returns The updated ASN.
         */
-       public async deleteASN(asnOrId: number | ResponseASN): Promise<void> {
-               const id = typeof(asnOrId) === "number" ? asnOrId : asnOrId.id;
+       public async updateASN(asn: ResponseASN): Promise<ResponseASN> {
+               const path = `asns/${asn.id}`;
+               return this.put<ResponseASN>(path, asn).toPromise();
+       }
+
+       /**
+        * Creates a new ASN.
+        *
+        * @param asn The ASN to create.
+        * @returns The created ASN.
+        */
+       public async createASN(asn: RequestASN): Promise<ResponseASN> {
+               return this.post<ResponseASN>("asns", asn).toPromise();
+       }
+
+       /**
+        * Deletes an existing ASN.
+        *
+        * @param asnID ID of the ASN to delete.

Review Comment:
   This argument is either the ASN itself, or the ID of the ASN to be deleted, 
not just its ID.



-- 
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

Reply via email to