resetPasswordAPI function

Future<ResetPassModel> resetPasswordAPI(
  1. {required String email,
  2. required String password,
  3. required String confirmPass}
)

Implementation

Future<ResetPassModel> resetPasswordAPI({required String email, required String password, required String confirmPass}) async {
  appStore.setLoading(true);
  try {
    ResetPassModel res = ResetPassModel.fromMap(await handleResponse(await buildHttpResponse('${APIEndPoint.resetPassword}',
        request: {
          UserKeys.email: email.trim(),
          UserKeys.password: password.trim(),
          UserKeys.passwordConfirmation: confirmPass.trim(),
        },
        method: HttpMethod.POST)));

    await appStore.setCurrentPassword(password.trim());

    appStore.setLoading(false);
    return res;
  } catch (e) {
    appStore.setLoading(false);
    throw e;
  }
}