Skip to content

Commit

Permalink
Merge pull request #14 from poojakarma/userid_variable_name_changes
Browse files Browse the repository at this point in the history
PS-2439 : added correct userId variable name
  • Loading branch information
Shubham4026 authored Nov 14, 2024
2 parents 3a23a37 + 6f123a5 commit 75570a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/modules/notification/notification.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export class NotificationController {
@ApiBadRequestResponse({ description: 'Invalid Request' })
@ApiBody({ type: NotificationDto })
async sendNotification(
@Body() notificationDto: NotificationDto, @Res() response: Response, @Query('userid') userid: string | null
@Body() notificationDto: NotificationDto, @Res() response: Response, @Query('userId') userId: string | null
) {
if (!notificationDto.email && !notificationDto.push && !notificationDto.sms) {
throw new BadRequestException('At least one of email, push, or sms is required.');
}
return this.notificationService.sendNotification(notificationDto, userid, response);
return this.notificationService.sendNotification(notificationDto, userId, response);
}

// @Post('subscribetotopic')
Expand Down
21 changes: 10 additions & 11 deletions src/modules/notification_events/notification_events.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export class NotificationEventsController {
@ApiBadRequestResponse({ description: ERROR_MESSAGES.INVALID_REQUEST })
@UsePipes(new ValidationPipe({ transform: true }))
@ApiBody({ type: CreateEventDto })
@ApiQuery({ name: 'userid', required: true, description: ERROR_MESSAGES.USERID_REQUIRED })
@ApiQuery({ name: 'userId', required: true, description: ERROR_MESSAGES.USERID_REQUIRED })
async create(
@Body() createEventDto: CreateEventDto,
@Res() response: Response,
@Query('userid', new ParseUUIDPipe({ exceptionFactory: () => new BadRequestException(ERROR_MESSAGES.USERID_UUID) })) userid: string
@Query('userId', new ParseUUIDPipe({ exceptionFactory: () => new BadRequestException(ERROR_MESSAGES.USERID_UUID) })) userId: string
) {
return this.notificationeventsService.createTemplate(userid, createEventDto, response);
return this.notificationeventsService.createTemplate(userId, createEventDto, response);
}

@UseFilters(new AllExceptionsFilter(APIID.TEMPLATE_LIST))
Expand All @@ -38,27 +38,27 @@ export class NotificationEventsController {
@ApiBadRequestResponse({ description: ERROR_MESSAGES.INVALID_REQUEST })
@UsePipes(new ValidationPipe({ transform: true }))
@ApiOkResponse({ description: SUCCESS_MESSAGES.TEMPLATE_LIST })
async getTemplates(@Body() searchFilterDto: SearchFilterDto, @Res() response: Response, @Query('userid') userid: string | null) {
return this.notificationeventsService.getTemplates(searchFilterDto, userid, response)
async getTemplates(@Body() searchFilterDto: SearchFilterDto, @Res() response: Response, @Query('userId') userId: string | null) {
return this.notificationeventsService.getTemplates(searchFilterDto, userId, response)
}

@UseFilters(new AllExceptionsFilter(APIID.TEMPLATE_GET))
@Patch("/:id")
@ApiBody({ type: UpdateEventDto })
@ApiResponse({ status: 200, description: SUCCESS_MESSAGES.UPDATE_TEMPLATE_API })
@ApiResponse({ status: 400, description: ERROR_MESSAGES.BAD_REQUEST })
@ApiQuery({ name: 'userid', required: true, description: ERROR_MESSAGES.USERID_REQUIRED })
@ApiQuery({ name: 'userId', required: true, description: ERROR_MESSAGES.USERID_REQUIRED })
@UsePipes(new ValidationPipe({ transform: true }))
updateEvent(
@Param("id") id: number,
@Body() updateEventDto: UpdateEventDto,
@Res() response: Response,
@Query('userid', new ParseUUIDPipe({ exceptionFactory: () => new BadRequestException(ERROR_MESSAGES.USERID_REQUIRED) })) userid: string
@Query('userId', new ParseUUIDPipe({ exceptionFactory: () => new BadRequestException(ERROR_MESSAGES.USERID_REQUIRED) })) userId: string
) {
return this.notificationeventsService.updateNotificationTemplate(
id,
updateEventDto,
userid,
userId,
response
);
}
Expand All @@ -69,8 +69,7 @@ export class NotificationEventsController {
@UsePipes(new ValidationPipe({ transform: true }))
@ApiResponse({ status: 200, description: SUCCESS_MESSAGES.TEMPLATE_DELETE })
@ApiResponse({ status: 404, description: ERROR_MESSAGES.TEMPLATE_NOTFOUND })
deleteTemplate(@Param('id') id: number, @Res() response: Response, @Query('userid') userid: string) {
return this.notificationeventsService.deleteTemplate(id, userid, response)
deleteTemplate(@Param('id') id: number, @Res() response: Response, @Query('userId') userId: string) {
return this.notificationeventsService.deleteTemplate(id, userId, response)
}

}

0 comments on commit 75570a2

Please sign in to comment.