-
Notifications
You must be signed in to change notification settings - Fork 0
Fix migration Issue #8
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
Conversation
|
Fix conflicts |
| @Entity('email_verifications') | ||
| export class EmailVerification { | ||
| @PrimaryGeneratedColumn('uuid') | ||
| id: string; |
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.
readonly id :string,
make all column names readonly.
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.
done
pratham-outside
left a comment
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.
Fix merge conflicts
fixed |
src/auth/auth.service.ts
Outdated
| const user = await this.userRepository.findOne({ where: { email } }); | ||
| const user = await this.userService.findOneByField('email', email); | ||
| if (!user) { | ||
| throw new BadRequestException('User 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.
Maybe NotFoundException would be better here as well
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.
Thank you updated
src/auth/auth.service.ts
Outdated
| } | ||
|
|
||
| if (user.verifiedAt) { | ||
| throw new BadRequestException('User is already verified'); |
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 aslo do check if ConflictException could work here
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.
thanks. updated
src/auth/auth.service.ts
Outdated
| }, | ||
| }); | ||
| const user = await this.userService.findOneByField('email', payload.email); | ||
| if (!user) throw new Error('User 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.
As I have also been suggested; that the below structure would be better for readability.
| if (!user) throw new Error('User not found'); | |
| if (!user) | |
| { | |
| throw new Error('User 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.
updated thank you
src/auth/auth.service.ts
Outdated
| throw new BadRequestException('User not found'); | ||
| } | ||
|
|
||
| if (user.verifiedAt === null) { |
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.
Maybe you could also consider if (!user.verifiedAtl) to keep flexibility for other falsy values like NaN, undefined, 0,etc.
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.
thank you updated.
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.
Maybe you could also add @IsString decorators so that the validation pipe could validate it before reaching the controller
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.
thank you. the dtos are validated well in the feat-refactor branch
Uh oh!
There was an error while loading. Please reload this page.