await sendEmail (req.body.email, this.verificationCode) throws an error:
this.verificationCode = undefined
How can I fix this?
class VerificationCodeController{
constructor(){
this.verificationCode = generateCode()
}
async sendCode(req, res){
await sendEmail(req.body.email, this.verificationCode)
return res.json(responseCreator.response(this.verificationCode));
}
}