forgotPassword function
Implementation
Future<ForgotPasswordResponse> forgotPassword({required String email}) async {
appStore.setLoading(true);
try {
ForgotPasswordResponse res = ForgotPasswordResponse.fromMap(await handleResponse(await buildHttpResponse('${APIEndPoint.forgotPassword}', request: {UserKeys.email: email.trim()}, method: HttpMethod.POST)));
appStore.setOtpCode('');
if (res.data != null) {
toast(res.data!.message.validate());
appStore.setOtpCode(res.data!.otp.toString().validate());
}
appStore.setLoading(false);
return res;
} catch (e) {
appStore.setLoading(false);
throw e;
}
}