diff --git a/src/modules/notification/notification.controller.ts b/src/modules/notification/notification.controller.ts index 0191f16..d02a0a1 100644 --- a/src/modules/notification/notification.controller.ts +++ b/src/modules/notification/notification.controller.ts @@ -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') diff --git a/src/modules/notification_events/notification_events.controller.ts b/src/modules/notification_events/notification_events.controller.ts index beafc53..d5d6d10 100644 --- a/src/modules/notification_events/notification_events.controller.ts +++ b/src/modules/notification_events/notification_events.controller.ts @@ -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)) @@ -38,8 +38,8 @@ 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)) @@ -47,18 +47,18 @@ export class NotificationEventsController { @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 ); } @@ -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) } - }