Skip to content

Conversation

@laxman-aqw
Copy link
Collaborator

@laxman-aqw laxman-aqw commented Oct 14, 2025

  • Fixed migration issue.
  • create migration files succesfully
  • run the migration succesfully
  • revert the migration succesfully

@laxman-aqw laxman-aqw self-assigned this Oct 14, 2025
@laxman-aqw laxman-aqw changed the title Fix migration Fix migration Issue Oct 14, 2025
@pratham-outside
Copy link

Fix conflicts

@Entity('email_verifications')
export class EmailVerification {
@PrimaryGeneratedColumn('uuid')
id: string;
Copy link

@pratham-outside pratham-outside Oct 14, 2025

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link

@pratham-outside pratham-outside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix merge conflicts

@laxman-aqw laxman-aqw changed the base branch from feat-login to feat-guards October 15, 2025 06:35
@laxman-aqw
Copy link
Collaborator Author

Fix merge conflicts

fixed

@laxman-aqw laxman-aqw changed the base branch from feat-guards to develop November 6, 2025 07:10
const user = await this.userRepository.findOne({ where: { email } });
const user = await this.userService.findOneByField('email', email);
if (!user) {
throw new BadRequestException('User not found');
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you updated

}

if (user.verifiedAt) {
throw new BadRequestException('User is already verified');
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. updated

},
});
const user = await this.userService.findOneByField('email', payload.email);
if (!user) throw new Error('User not found');
Copy link
Collaborator

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.

Suggested change
if (!user) throw new Error('User not found');
if (!user)
{
throw new Error('User not found');
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated thank you

throw new BadRequestException('User not found');
}

if (user.verifiedAt === null) {
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you updated.

Copy link
Collaborator

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

Copy link
Collaborator Author

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

@laxman-aqw laxman-aqw merged commit e129eaf into develop Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants