
I have turned the default function to async but still even after using await the code does not wait at
otpData = await database.getDocument(//credentials)
// as the code does not await this, the line below causes an error
// error:: connot read the otp of undefined
otp = otpData.data['otp']
Please do help how am I to tackle such a scenario

I'm sure that getDocument
returns the data inside data
property.
Try to logout the otpData
variable to see what you're getting back.
From what I've seen it should be something like this.
otpData = await database.getDocument(//credentials)
otp = otpData['otp']

Okay alright understood thanks

It worked

thanks a lot

apologies for not getting such a thing right

[SOLVED] Cannot do Asynchronous Programming in a Function
Recommended threads
- Error
I'm trying to get sellerId using account.get() in my appwrite function and this is the error message I'm getting: "Failed to send notification to seller 6865bf...
- Is there a timeframe for updating dart r...
Dart 3.5 is already one year old, and the following versions have introduced very important features for the language. Is there a roadmap or timeframe for when...
- Error
I'm trying to get sellerId using account.get() in my appwrite function and this is the error message I'm getting: "Failed to send notification to seller 6865bf...
