Skip to content

Incorrect method call for getting user with email #9

Closed
@Gambitier

Description

Describe the bug
Incorrect method call for fetching user with email on line number 84

public generateOtp = async (otpDetails: any): Promise<boolean> => {
var person: PersonDetailsDto = null;
if (otpDetails.Phone) {
person = await this._personRepo.getPersonWithPhone(otpDetails.Phone);
if (person == null) {
let message = 'User does not exist with phone(' + otpDetails.Phone + ')';
throw new ApiError(404, message);
}
} else if (otpDetails.Email) {
person = await this._personRepo.getPersonWithPhone(otpDetails.Email);
if (person == null) {
let message = 'User does not exist with email(' + otpDetails.Email + ')';
throw new ApiError(404, message);
}
}

To Reproduce

  • N/A

Expected behavior
code should should be

person = await this._personRepo.getPersonWithEmail(otpDetails.Email);

Screenshots

  • N/A

Desktop (please complete the following information):

  • N/A

Smartphone (please complete the following information):

  • N/A

Additional context

  • N/A

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions