rimashah25 commented on code in PR #7514:
URL: https://github.com/apache/trafficcontrol/pull/7514#discussion_r1198599707


##########
experimental/traffic-portal/src/app/api/testing/user.service.ts:
##########
@@ -428,6 +438,50 @@ export class UserService {
                return this.roles;
        }
 
+       /**
+        * Creates a new role.
+        *
+        * @param role The role to create.
+        * @returns The created role.
+        */
+       public async createRole(role: RequestRole): Promise<ResponseRole> {
+               const resp = {
+                       ...role,
+               };
+               this.roleDetail.push(resp);
+               return resp;
+       }
+
+       /**
+        * Updates an existing role.
+        *
+        * @param role The role to update.
+        * @returns The updated role.
+        */
+       public async updateRole(role: ResponseRole): Promise<ResponseRole> {
+               const roleName = this.roleDetail.findIndex(r => r.name === 
role.name);
+               if (roleName < 0 ) {
+                       throw new Error(`no such Role: ${role.name}`);
+               }
+               this.roleDetail[roleName] = role;
+               return role;
+       }
+
+       /**
+        * Deletes an existing role.
+        *
+        * @param role The role to be deleted.
+        * @returns The deleted role.
+        */
+       public async deleteRole(role: string | ResponseRole): 
Promise<ResponseRole> {

Review Comment:
   Nope, I changed the "concrete" service to return ```Promise<ResponseRole>```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to