From 33c457333ef969ddd348cd2274e86d5cf5f21ea0 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Wed, 20 Nov 2024 17:52:24 +0530 Subject: [PATCH 1/4] feat: check user existence Signed-off-by: bhavanakarwade --- .../organization/organization.controller.ts | 15 ++++++ .../src/organization/organization.service.ts | 5 ++ apps/api-gateway/src/user/user.controller.ts | 17 +++++++ apps/api-gateway/src/user/user.service.ts | 5 ++ .../repositories/organization.repository.ts | 51 +++++++++++++++++++ .../src/organization.controller.ts | 6 +++ apps/organization/src/organization.service.ts | 38 ++++++++++++++ apps/user/interfaces/user.interface.ts | 2 +- apps/user/repositories/user.repository.ts | 14 +++++ apps/user/src/user.controller.ts | 5 ++ apps/user/src/user.service.ts | 15 ++++++ libs/common/src/response-messages/index.ts | 1 + 12 files changed, 173 insertions(+), 1 deletion(-) diff --git a/apps/api-gateway/src/organization/organization.controller.ts b/apps/api-gateway/src/organization/organization.controller.ts index 7b18068ba..d6d9ad660 100644 --- a/apps/api-gateway/src/organization/organization.controller.ts +++ b/apps/api-gateway/src/organization/organization.controller.ts @@ -249,6 +249,21 @@ export class OrganizationController { } + @Get('/user-orgs/:email') + @ApiOperation({ summary: 'Get all organizations by user email', description: 'Get all organizations by user email' }) + @ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto }) + async getAllOrganizations(@Param('email') email: string, @Res() res: Response): Promise { + const getOrganizations = await this.organizationService.getAllOrganizations(email); + + const finalResponse: IResponse = { + statusCode: HttpStatus.OK, + message: ResponseMessages.organisation.success.getOrganizations, + data: getOrganizations + }; + return res.status(HttpStatus.OK).json(finalResponse); + + } + /** * @returns Organization details */ diff --git a/apps/api-gateway/src/organization/organization.service.ts b/apps/api-gateway/src/organization/organization.service.ts index 88b00b0de..6774868c9 100644 --- a/apps/api-gateway/src/organization/organization.service.ts +++ b/apps/api-gateway/src/organization/organization.service.ts @@ -116,6 +116,11 @@ export class OrganizationService extends BaseService { return this.sendNatsMessage(this.serviceProxy, 'get-organization-by-id', payload); } + async getAllOrganizations(email: string): Promise { + const payload = { email }; + return this.sendNatsMessage(this.serviceProxy, 'get-organizations-by-user-email', payload); + } + async fetchOrgCredentials(orgId: string, userId: string): Promise { const payload = { orgId, userId }; return this.sendNatsMessage(this.serviceProxy, 'fetch-org-client-credentials', payload); diff --git a/apps/api-gateway/src/user/user.controller.ts b/apps/api-gateway/src/user/user.controller.ts index 8cea509d0..2ce4b8f3e 100644 --- a/apps/api-gateway/src/user/user.controller.ts +++ b/apps/api-gateway/src/user/user.controller.ts @@ -127,6 +127,23 @@ export class UserController { return res.status(HttpStatus.OK).json(finalResponse); } + @Get('user-details/:email') + @ApiOperation({ + summary: 'Fetch user details', + description: 'Fetch user details' + }) + async getUserDetails(@Param('email') email: string, @Res() res: Response): Promise { + + const userDetails = await this.userService.getUserDetails(email); + const finalResponse: IResponse = { + statusCode: HttpStatus.OK, + message: ResponseMessages.user.success.fetchUserDetails, + data: userDetails + }; + + return res.status(HttpStatus.OK).json(finalResponse); + } + @Get('/profile') @ApiOperation({ summary: 'Fetch login user details', diff --git a/apps/api-gateway/src/user/user.service.ts b/apps/api-gateway/src/user/user.service.ts index 4e6d365eb..69db07d0b 100644 --- a/apps/api-gateway/src/user/user.service.ts +++ b/apps/api-gateway/src/user/user.service.ts @@ -28,6 +28,11 @@ export class UserService extends BaseService { return this.sendNatsMessage(this.serviceProxy, 'get-user-public-profile', payload); } + async getUserDetails(email: string): Promise { + const payload = { email }; + return this.sendNatsMessage(this.serviceProxy, 'get-user-details', payload); + } + async updateUserProfile(updateUserProfileDto: UpdateUserProfileDto): Promise { const payload = { updateUserProfileDto }; return this.sendNatsMessage(this.serviceProxy, 'update-user-profile', payload); diff --git a/apps/organization/repositories/organization.repository.ts b/apps/organization/repositories/organization.repository.ts index ae6be69dc..57b75bc94 100644 --- a/apps/organization/repositories/organization.repository.ts +++ b/apps/organization/repositories/organization.repository.ts @@ -412,6 +412,57 @@ export class OrganizationRepository { } } + async getUserOrgIds(userId: string): Promise { + try { + const getUserorgs = await this.prisma.user_org_roles.findMany({ + where:{ + userId + }}); + return getUserorgs; + + } catch (error) { + this.logger.error(`error: ${JSON.stringify(error)}`); + throw new error; + } + } + + async fetchUserOrganizations(orgIds: string[]): Promise { + try { + const userOrgs = await this.prisma.organisation.findMany({ + where:{ + id: { + in: orgIds + } + }, + select: + { + id: true, + name: true, + description: true, + orgSlug: true, + logoUrl: true, + website: true, + publicProfile: true, + cityId: true, + countryId: true, + stateId: true, + clientId: true, + clientSecret: true, + registrationNumber: true, + org_agents: { + select: { + orgDid: true, + agentSpinUpStatus: true + } + } + }}); + return userOrgs; + } catch (error) { + this.logger.error(`error: ${JSON.stringify(error)}`); + throw new error; + } + } + async getOrganization(queryObject: object): Promise { try { return this.prisma.organisation.findFirst({ diff --git a/apps/organization/src/organization.controller.ts b/apps/organization/src/organization.controller.ts index ca93335e0..446c573fd 100644 --- a/apps/organization/src/organization.controller.ts +++ b/apps/organization/src/organization.controller.ts @@ -116,6 +116,12 @@ export class OrganizationController { async getOrganization(@Body() payload: { orgId: string; userId: string}): Promise { return this.organizationService.getOrganization(payload.orgId); } + + @MessagePattern({ cmd: 'get-organizations-by-user-email' }) + async getAllOrganizations(payload: { email: string}): Promise { + return this.organizationService.getAllUserOrganizations(payload.email); + } + /** * @param orgSlug * @returns organization details diff --git a/apps/organization/src/organization.service.ts b/apps/organization/src/organization.service.ts index 26b1124a8..22bff9bf0 100644 --- a/apps/organization/src/organization.service.ts +++ b/apps/organization/src/organization.service.ts @@ -778,6 +778,44 @@ export class OrganizationService { } } + async getAllUserOrganizations(email: string): Promise { + try { + const getUserDetails = await this._userDetails(email); + + const getUserOrgs = await this.organizationRepository.getUserOrgIds(getUserDetails?.['id']); + + const orgIds = getUserOrgs?.map((item) => item?.orgId).filter((id) => null !== id); + + const organizationDetails = await this.organizationRepository.fetchUserOrganizations(orgIds); + return organizationDetails; + } catch (error) { + this.logger.error(`In get user organizations : ${JSON.stringify(error)}`); + throw new RpcException(error.response ? error.response : error); + } + } + + async _userDetails(email: string): Promise { + const pattern = { cmd: 'get-user-details' }; + const payload = { + email + }; + const userDetails = await this.organizationServiceProxy + .send(pattern, payload) + .toPromise() + .catch((error) => { + this.logger.error(`catch: ${JSON.stringify(error)}`); + throw new HttpException( + { + status: error.status, + error: error.message + }, + error.status + ); + }); + + return userDetails; + } + /** * Description: get invitation * @param orgId Registration Details diff --git a/apps/user/interfaces/user.interface.ts b/apps/user/interfaces/user.interface.ts index 063584c04..ef7c57604 100644 --- a/apps/user/interfaces/user.interface.ts +++ b/apps/user/interfaces/user.interface.ts @@ -25,7 +25,7 @@ interface IUserOrgRole { description: string; }; export interface IOrganisation{ - id: string; + id: string; name: string; description: string; orgSlug: string; diff --git a/apps/user/repositories/user.repository.ts b/apps/user/repositories/user.repository.ts index 132678272..b2712686c 100644 --- a/apps/user/repositories/user.repository.ts +++ b/apps/user/repositories/user.repository.ts @@ -738,6 +738,20 @@ export class UserRepository { } } + async fetchUserDetails(email: string): Promise { + try { + const userDetails = await this.prisma.user.findUnique({ + where: { + email + } + }); + return userDetails; + } catch (error) { + this.logger.error(`Error in getting user details: ${error} `); + throw error; + } + } + async getUserKeycloak(userEmails: string[]): Promise { try { const users = await this.prisma.user.findMany({ diff --git a/apps/user/src/user.controller.ts b/apps/user/src/user.controller.ts index a97889eef..909c80bc6 100644 --- a/apps/user/src/user.controller.ts +++ b/apps/user/src/user.controller.ts @@ -70,6 +70,11 @@ export class UserController { return this.userService.getProfile(payload); } + @MessagePattern({ cmd: 'get-user-details' }) + async getUserDetails(payload: { email: string }): Promise { + return this.userService.fetchUserDetails(payload.email); + } + @MessagePattern({ cmd: 'get-user-public-profile' }) async getPublicProfile(payload: { username }): Promise { return this.userService.getPublicProfile(payload); diff --git a/apps/user/src/user.service.ts b/apps/user/src/user.service.ts index dc43558fd..75a2114ed 100644 --- a/apps/user/src/user.service.ts +++ b/apps/user/src/user.service.ts @@ -1077,6 +1077,21 @@ export class UserService { } } + async fetchUserDetails(email: string): Promise { + try { + const userDetails = await this.userRepository.fetchUserDetails(email); + + if (!userDetails) { + throw new NotFoundException(ResponseMessages.user.error.notFound); + } + + return userDetails; + } catch (error) { + this.logger.error(`In get user details : ${JSON.stringify(error)}`); + throw new RpcException(error.response ? error.response : error); + } + } + async getUserKeycloakIdByEmail(userEmails: string[]): Promise { try { diff --git a/libs/common/src/response-messages/index.ts b/libs/common/src/response-messages/index.ts index 13b43cb9d..d26e2020e 100644 --- a/libs/common/src/response-messages/index.ts +++ b/libs/common/src/response-messages/index.ts @@ -6,6 +6,7 @@ export const ResponseMessages = { emaiVerified: 'Email verified successfully', login: 'User login successfully', fetchProfile: 'User fetched successfully', + fetchUserDetails: 'User details fetched successfully', fetchInvitations: 'Org invitations fetched successfully', invitationReject: 'Organization invitation rejected', invitationAccept: 'Organization invitation accepted', From d4adbbc0cf364a56f655274396821fb85fe6a4d9 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Wed, 4 Dec 2024 11:12:17 +0530 Subject: [PATCH 2/4] refactor: added additional fields in login response Signed-off-by: bhavanakarwade --- apps/user/src/user.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/user/src/user.service.ts b/apps/user/src/user.service.ts index 75a2114ed..85aff6948 100644 --- a/apps/user/src/user.service.ts +++ b/apps/user/src/user.service.ts @@ -388,7 +388,7 @@ export class UserService { } else { const decryptedPassword = await this.commonService.decryptPassword(password); - return await this.generateToken(email.toLowerCase(), decryptedPassword, userData); + return await this.generateToken(email.toLowerCase(), decryptedPassword, userData); } } catch (error) { this.logger.error(`In Login User : ${JSON.stringify(error)}`); @@ -627,10 +627,13 @@ export class UserService { async generateToken(email: string, password: string, userData: user): Promise { if (userData.keycloakUserId) { - try { const tokenResponse = await this.clientRegistrationService.getUserToken(email, password, userData.clientId, userData.clientSecret); tokenResponse.isRegisteredToSupabase = false; + tokenResponse.userId = userData?.id; + tokenResponse.email = userData?.email; + tokenResponse.firstName = userData?.firstName; + tokenResponse.lastName = userData?.lastName; return tokenResponse; } catch (error) { throw new UnauthorizedException(ResponseMessages.user.error.invalidCredentials); From 4e17817642efb5463efac0b99ac2354100c28554 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Wed, 4 Dec 2024 11:47:24 +0530 Subject: [PATCH 3/4] fix: removed unnecessary code Signed-off-by: bhavanakarwade --- .../organization/organization.controller.ts | 15 ------ .../src/organization/organization.service.ts | 7 +-- apps/api-gateway/src/user/user.controller.ts | 17 ------- apps/api-gateway/src/user/user.service.ts | 5 -- .../repositories/organization.repository.ts | 51 ------------------- .../src/organization.controller.ts | 5 -- apps/organization/src/organization.service.ts | 38 -------------- apps/user/repositories/user.repository.ts | 14 ----- apps/user/src/user.controller.ts | 5 -- apps/user/src/user.service.ts | 17 +------ libs/common/src/response-messages/index.ts | 1 - 11 files changed, 2 insertions(+), 173 deletions(-) diff --git a/apps/api-gateway/src/organization/organization.controller.ts b/apps/api-gateway/src/organization/organization.controller.ts index d6d9ad660..7b18068ba 100644 --- a/apps/api-gateway/src/organization/organization.controller.ts +++ b/apps/api-gateway/src/organization/organization.controller.ts @@ -249,21 +249,6 @@ export class OrganizationController { } - @Get('/user-orgs/:email') - @ApiOperation({ summary: 'Get all organizations by user email', description: 'Get all organizations by user email' }) - @ApiResponse({ status: HttpStatus.OK, description: 'Success', type: ApiResponseDto }) - async getAllOrganizations(@Param('email') email: string, @Res() res: Response): Promise { - const getOrganizations = await this.organizationService.getAllOrganizations(email); - - const finalResponse: IResponse = { - statusCode: HttpStatus.OK, - message: ResponseMessages.organisation.success.getOrganizations, - data: getOrganizations - }; - return res.status(HttpStatus.OK).json(finalResponse); - - } - /** * @returns Organization details */ diff --git a/apps/api-gateway/src/organization/organization.service.ts b/apps/api-gateway/src/organization/organization.service.ts index 1e9e90dcf..8d394559a 100644 --- a/apps/api-gateway/src/organization/organization.service.ts +++ b/apps/api-gateway/src/organization/organization.service.ts @@ -116,12 +116,7 @@ export class OrganizationService extends BaseService { const payload = { orgId, userId }; return this.natsClient.sendNatsMessage(this.serviceProxy, 'get-organization-by-id', payload); } - - async getAllOrganizations(email: string): Promise { - const payload = { email }; - return this.sendNatsMessage(this.serviceProxy, 'get-organizations-by-user-email', payload); - } - + async fetchOrgCredentials(orgId: string, userId: string): Promise { const payload = { orgId, userId }; return this.natsClient.sendNatsMessage(this.serviceProxy, 'fetch-org-client-credentials', payload); diff --git a/apps/api-gateway/src/user/user.controller.ts b/apps/api-gateway/src/user/user.controller.ts index 2ce4b8f3e..8cea509d0 100644 --- a/apps/api-gateway/src/user/user.controller.ts +++ b/apps/api-gateway/src/user/user.controller.ts @@ -127,23 +127,6 @@ export class UserController { return res.status(HttpStatus.OK).json(finalResponse); } - @Get('user-details/:email') - @ApiOperation({ - summary: 'Fetch user details', - description: 'Fetch user details' - }) - async getUserDetails(@Param('email') email: string, @Res() res: Response): Promise { - - const userDetails = await this.userService.getUserDetails(email); - const finalResponse: IResponse = { - statusCode: HttpStatus.OK, - message: ResponseMessages.user.success.fetchUserDetails, - data: userDetails - }; - - return res.status(HttpStatus.OK).json(finalResponse); - } - @Get('/profile') @ApiOperation({ summary: 'Fetch login user details', diff --git a/apps/api-gateway/src/user/user.service.ts b/apps/api-gateway/src/user/user.service.ts index 6cf49b7cb..c3988d810 100644 --- a/apps/api-gateway/src/user/user.service.ts +++ b/apps/api-gateway/src/user/user.service.ts @@ -29,11 +29,6 @@ export class UserService extends BaseService { return this.natsClient.sendNatsMessage(this.serviceProxy, 'get-user-public-profile', payload); } - async getUserDetails(email: string): Promise { - const payload = { email }; - return this.sendNatsMessage(this.serviceProxy, 'get-user-details', payload); - } - async updateUserProfile(updateUserProfileDto: UpdateUserProfileDto): Promise { const payload = { updateUserProfileDto }; return this.natsClient.sendNatsMessage(this.serviceProxy, 'update-user-profile', payload); diff --git a/apps/organization/repositories/organization.repository.ts b/apps/organization/repositories/organization.repository.ts index d5824bef8..d3fd36e91 100644 --- a/apps/organization/repositories/organization.repository.ts +++ b/apps/organization/repositories/organization.repository.ts @@ -412,57 +412,6 @@ export class OrganizationRepository { } } - async getUserOrgIds(userId: string): Promise { - try { - const getUserorgs = await this.prisma.user_org_roles.findMany({ - where:{ - userId - }}); - return getUserorgs; - - } catch (error) { - this.logger.error(`error: ${JSON.stringify(error)}`); - throw new error; - } - } - - async fetchUserOrganizations(orgIds: string[]): Promise { - try { - const userOrgs = await this.prisma.organisation.findMany({ - where:{ - id: { - in: orgIds - } - }, - select: - { - id: true, - name: true, - description: true, - orgSlug: true, - logoUrl: true, - website: true, - publicProfile: true, - cityId: true, - countryId: true, - stateId: true, - clientId: true, - clientSecret: true, - registrationNumber: true, - org_agents: { - select: { - orgDid: true, - agentSpinUpStatus: true - } - } - }}); - return userOrgs; - } catch (error) { - this.logger.error(`error: ${JSON.stringify(error)}`); - throw new error; - } - } - async getOrganization(queryObject: object): Promise { try { return this.prisma.organisation.findFirst({ diff --git a/apps/organization/src/organization.controller.ts b/apps/organization/src/organization.controller.ts index 446c573fd..0eab6112e 100644 --- a/apps/organization/src/organization.controller.ts +++ b/apps/organization/src/organization.controller.ts @@ -117,11 +117,6 @@ export class OrganizationController { return this.organizationService.getOrganization(payload.orgId); } - @MessagePattern({ cmd: 'get-organizations-by-user-email' }) - async getAllOrganizations(payload: { email: string}): Promise { - return this.organizationService.getAllUserOrganizations(payload.email); - } - /** * @param orgSlug * @returns organization details diff --git a/apps/organization/src/organization.service.ts b/apps/organization/src/organization.service.ts index 85a231b19..92eb2cadd 100644 --- a/apps/organization/src/organization.service.ts +++ b/apps/organization/src/organization.service.ts @@ -780,44 +780,6 @@ export class OrganizationService { } } - async getAllUserOrganizations(email: string): Promise { - try { - const getUserDetails = await this._userDetails(email); - - const getUserOrgs = await this.organizationRepository.getUserOrgIds(getUserDetails?.['id']); - - const orgIds = getUserOrgs?.map((item) => item?.orgId).filter((id) => null !== id); - - const organizationDetails = await this.organizationRepository.fetchUserOrganizations(orgIds); - return organizationDetails; - } catch (error) { - this.logger.error(`In get user organizations : ${JSON.stringify(error)}`); - throw new RpcException(error.response ? error.response : error); - } - } - - async _userDetails(email: string): Promise { - const pattern = { cmd: 'get-user-details' }; - const payload = { - email - }; - const userDetails = await this.organizationServiceProxy - .send(pattern, payload) - .toPromise() - .catch((error) => { - this.logger.error(`catch: ${JSON.stringify(error)}`); - throw new HttpException( - { - status: error.status, - error: error.message - }, - error.status - ); - }); - - return userDetails; - } - /** * Description: get invitation * @param orgId Registration Details diff --git a/apps/user/repositories/user.repository.ts b/apps/user/repositories/user.repository.ts index b2712686c..132678272 100644 --- a/apps/user/repositories/user.repository.ts +++ b/apps/user/repositories/user.repository.ts @@ -738,20 +738,6 @@ export class UserRepository { } } - async fetchUserDetails(email: string): Promise { - try { - const userDetails = await this.prisma.user.findUnique({ - where: { - email - } - }); - return userDetails; - } catch (error) { - this.logger.error(`Error in getting user details: ${error} `); - throw error; - } - } - async getUserKeycloak(userEmails: string[]): Promise { try { const users = await this.prisma.user.findMany({ diff --git a/apps/user/src/user.controller.ts b/apps/user/src/user.controller.ts index 909c80bc6..a97889eef 100644 --- a/apps/user/src/user.controller.ts +++ b/apps/user/src/user.controller.ts @@ -70,11 +70,6 @@ export class UserController { return this.userService.getProfile(payload); } - @MessagePattern({ cmd: 'get-user-details' }) - async getUserDetails(payload: { email: string }): Promise { - return this.userService.fetchUserDetails(payload.email); - } - @MessagePattern({ cmd: 'get-user-public-profile' }) async getPublicProfile(payload: { username }): Promise { return this.userService.getPublicProfile(payload); diff --git a/apps/user/src/user.service.ts b/apps/user/src/user.service.ts index 9b0ca358a..8d540d8b2 100644 --- a/apps/user/src/user.service.ts +++ b/apps/user/src/user.service.ts @@ -390,7 +390,7 @@ export class UserService { } else { const decryptedPassword = await this.commonService.decryptPassword(password); - return await this.generateToken(email.toLowerCase(), decryptedPassword, userData); + return await this.generateToken(email.toLowerCase(), decryptedPassword, userData); } } catch (error) { this.logger.error(`In Login User : ${JSON.stringify(error)}`); @@ -1082,21 +1082,6 @@ export class UserService { } } - async fetchUserDetails(email: string): Promise { - try { - const userDetails = await this.userRepository.fetchUserDetails(email); - - if (!userDetails) { - throw new NotFoundException(ResponseMessages.user.error.notFound); - } - - return userDetails; - } catch (error) { - this.logger.error(`In get user details : ${JSON.stringify(error)}`); - throw new RpcException(error.response ? error.response : error); - } - } - async getUserKeycloakIdByEmail(userEmails: string[]): Promise { try { diff --git a/libs/common/src/response-messages/index.ts b/libs/common/src/response-messages/index.ts index d26e2020e..13b43cb9d 100644 --- a/libs/common/src/response-messages/index.ts +++ b/libs/common/src/response-messages/index.ts @@ -6,7 +6,6 @@ export const ResponseMessages = { emaiVerified: 'Email verified successfully', login: 'User login successfully', fetchProfile: 'User fetched successfully', - fetchUserDetails: 'User details fetched successfully', fetchInvitations: 'Org invitations fetched successfully', invitationReject: 'Organization invitation rejected', invitationAccept: 'Organization invitation accepted', From 001e7fb06291c61f1c675e01494497cf1ec23699 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Wed, 4 Dec 2024 11:51:41 +0530 Subject: [PATCH 4/4] fix: removed spaces Signed-off-by: bhavanakarwade --- apps/api-gateway/src/organization/organization.service.ts | 2 +- apps/organization/src/organization.controller.ts | 1 - apps/user/interfaces/user.interface.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/api-gateway/src/organization/organization.service.ts b/apps/api-gateway/src/organization/organization.service.ts index 8d394559a..6a7e51a50 100644 --- a/apps/api-gateway/src/organization/organization.service.ts +++ b/apps/api-gateway/src/organization/organization.service.ts @@ -116,7 +116,7 @@ export class OrganizationService extends BaseService { const payload = { orgId, userId }; return this.natsClient.sendNatsMessage(this.serviceProxy, 'get-organization-by-id', payload); } - + async fetchOrgCredentials(orgId: string, userId: string): Promise { const payload = { orgId, userId }; return this.natsClient.sendNatsMessage(this.serviceProxy, 'fetch-org-client-credentials', payload); diff --git a/apps/organization/src/organization.controller.ts b/apps/organization/src/organization.controller.ts index 0eab6112e..ca93335e0 100644 --- a/apps/organization/src/organization.controller.ts +++ b/apps/organization/src/organization.controller.ts @@ -116,7 +116,6 @@ export class OrganizationController { async getOrganization(@Body() payload: { orgId: string; userId: string}): Promise { return this.organizationService.getOrganization(payload.orgId); } - /** * @param orgSlug * @returns organization details diff --git a/apps/user/interfaces/user.interface.ts b/apps/user/interfaces/user.interface.ts index ef7c57604..063584c04 100644 --- a/apps/user/interfaces/user.interface.ts +++ b/apps/user/interfaces/user.interface.ts @@ -25,7 +25,7 @@ interface IUserOrgRole { description: string; }; export interface IOrganisation{ - id: string; + id: string; name: string; description: string; orgSlug: string;