-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: refactored participant request (team, member) service #1936
Conversation
@navneethkrish is attempting to deploy a commit to the Protocol Labs Spaceport team on Vercel, but is not a member of this team. To resolve this issue, you can:
To read more about collaboration on Vercel, click here. |
51e6f55
to
0cb2058
Compare
3253319
to
cda4f01
Compare
0cb2058
to
5dd455d
Compare
cbb4e18
to
7351eaf
Compare
imports: [CacheModule.register()], | ||
controllers: [AdminController], | ||
imports: [CacheModule.register(), ParticipantsRequestModule, SharedModule], | ||
controllers: [AdminParticipantsRequestController, AdminAuthController], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name can be simply ParticipantsRequestController
} | ||
console.log('generating token.....'); | ||
this.logger.info('Generating admin access token...'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can add some context like username
): Promise<any> { | ||
const participantRequest: ParticipantsRequest | null = await this.participantsRequestService.findOneByUid(uid); | ||
if (!participantRequest) { | ||
throw new NotFoundException('Request not found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change as Participant Request no found
!requestor.isDirectoryAdmin && | ||
referenceUid !== requestor.uid | ||
) { | ||
throw new ForbiddenException(`Member isn't authorized to update the member`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we implement/reuse any guards for this at the controller level?
} | ||
let isMemberAvailable = await this.membersService.isMemberExistForEmailId(oldEmailId); | ||
if (!isMemberAvailable) { | ||
throw new ForbiddenException('Your email seems to have been updated recently. Please login and try again'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please login and try again with your updated email
* @param member - The member object. | ||
* @returns True if the member is a directory admin, false otherwise. | ||
*/ | ||
checkIfAdminUser(member): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isMemberAdmin
* @param tx - Optional transaction client. | ||
* @returns Updated member object if a change was made, otherwise the original member object. | ||
*/ | ||
async updateTelegramIfChanged( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have updateFieldIfChanged - can we resuse that?
* @param tx - Optional transaction client. | ||
* @returns Updated member object if a change was made, otherwise the original member object. | ||
*/ | ||
async updateOfficeHoursIfChanged( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as telegram
}); | ||
} else if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why slack config logic removed?
@@ -13,7 +13,7 @@ export class SetupService { | |||
winston.format.timestamp(), | |||
winston.format.ms(), | |||
winston.format.printf((info) => { | |||
return `${info.timestamp} : ${info.level} - ${info.message}`; | |||
return `${JSON.stringify(info)}`;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
7351eaf
to
642f9be
Compare
Description
Add a few lines describing your changes
Tickets
Checklist before requesting a review