diff --git a/src/app.service.ts b/src/app.service.ts index 407c6ed..043a2a0 100644 --- a/src/app.service.ts +++ b/src/app.service.ts @@ -1,5 +1,4 @@ import { Injectable } from '@nestjs/common'; -import { EmailService } from './email/email.service'; @Injectable() export class AppService { diff --git a/src/auth/guards/auth.guard.ts b/src/auth/guards/auth.guard.ts index 837c68d..d247b04 100644 --- a/src/auth/guards/auth.guard.ts +++ b/src/auth/guards/auth.guard.ts @@ -29,14 +29,14 @@ export class AuthGuard implements CanActivate { if (!bearerToken) throw new UnauthorizedException( - 'please provide Bearer token in Authorization header.', + 'Please provide Bearer token in Authorization header.', ); const token = bearerToken.split(' ')[1]; if (!token) throw new UnauthorizedException( - 'auth token not found in Authorization header.', + 'Auth token not found in Authorization header.', ); const decodedToken = decodeJwtToken( @@ -44,9 +44,9 @@ export class AuthGuard implements CanActivate { this.configService.get('APP_KEY', { infer: true }), ) as any; - if (!decodedToken) + if (!decodedToken) throw new UnauthorizedException( - 'invalid auth token or token has expired, please login to get new token.', + 'Invalid auth token or token has expired, please login to get new token.', ); const sessionId = decodedToken?.sessionId; @@ -55,7 +55,7 @@ export class AuthGuard implements CanActivate { const authSession = await this.authSessionService.get(sessionId); if (!authSession || authSession?.authTokenVersion != authTokenVersion) { - throw new UnauthorizedException('please login again.'); + throw new UnauthorizedException('Please login again.'); } request['user'] = { diff --git a/src/messenger/messenger.service.ts b/src/messenger/messenger.service.ts index 9c2aa67..b92e582 100644 --- a/src/messenger/messenger.service.ts +++ b/src/messenger/messenger.service.ts @@ -37,7 +37,7 @@ export class MessengerService { if (!onlyOne) { throw new BadRequestException( - "only provide value for either 'send_at' or 'send_after', not both.", + "Only provide value for either 'send_at' or 'send_after', not both.", ); } @@ -64,7 +64,7 @@ export class MessengerService { if (!savedMessage) { throw new UnprocessableEntityException( - 'failed to create message. please try again.', + 'Failed to create message. Please try again.', ); } @@ -82,7 +82,7 @@ export class MessengerService { if (!job) { throw new UnprocessableEntityException( - 'failed to add message. please try again', + 'Failed to add message. Please try again', ); } @@ -98,7 +98,7 @@ export class MessengerService { }); if (!message) { - throw new NotFoundException('message with id not found.'); + throw new NotFoundException('Message with id not found.'); } const user = await this.userRepository.findOneBy({ @@ -106,7 +106,7 @@ export class MessengerService { }); if (!user) { - throw new NotFoundException('user not found.'); + throw new NotFoundException('User not found.'); } const recipientEmail = user.email; diff --git a/src/user/user.service.ts b/src/user/user.service.ts index bdd6682..216f5ec 100644 --- a/src/user/user.service.ts +++ b/src/user/user.service.ts @@ -22,7 +22,7 @@ export class UserService { }); if (existingUser) { - throw new BadRequestException('user with this email already exists.'); + throw new BadRequestException('User with this email already exists.'); } const user = new User(); @@ -35,7 +35,7 @@ export class UserService { if (!saved) { throw new UnprocessableEntityException( - 'failed to add user. please try again.', + 'Failed to add user. Please try again.', ); }