From ac54b84235bdcf4d27a54f9eef7711dcb6b54d28 Mon Sep 17 00:00:00 2001 From: sanjay-k1910 Date: Thu, 22 Feb 2024 19:42:59 +0530 Subject: [PATCH] refactor: error messages in common messages Signed-off-by: sanjay-k1910 Signed-off-by: bhavanakarwade --- apps/api-gateway/src/authz/guards/ecosystem-roles.guard.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api-gateway/src/authz/guards/ecosystem-roles.guard.ts b/apps/api-gateway/src/authz/guards/ecosystem-roles.guard.ts index 099f1146a..af5b5b619 100644 --- a/apps/api-gateway/src/authz/guards/ecosystem-roles.guard.ts +++ b/apps/api-gateway/src/authz/guards/ecosystem-roles.guard.ts @@ -50,17 +50,17 @@ export class EcosystemRolesGuard implements CanActivate { const ecosystemOrgData = await this.ecosystemService.fetchEcosystemOrg(ecosystemId, orgId); if (!ecosystemOrgData) { - throw new ForbiddenException('Organization does not match'); + throw new ForbiddenException(ResponseMessages.organisation.error.orgDoesNotMatch); } user.ecosystemOrgRole = ecosystemOrgData['ecosystemRole']['name']; if (!user.ecosystemOrgRole) { - throw new ForbiddenException('Ecosystem role not match'); + throw new ForbiddenException(ResponseMessages.ecosystem.error.ecosystemRoleNotMatch); } } else { - throw new BadRequestException('organization & ecosystem is required'); + throw new BadRequestException(ResponseMessages.ecosystem.error.orgEcoIdRequired); } // Sending user friendly message if a user attempts to access an API that is inaccessible to their role