putResetPassword method

  1. @override
Future<bool> putResetPassword(
  1. String accountId,
  2. String verificationCode,
  3. String newPassword
)
override

Implementation

@override
Future<bool> putResetPassword(
    String accountId, String verificationCode, String newPassword) async {
  try {
    final String body = json.encode(
        {'vcode': '$verificationCode', 'user_newpwd': '$newPassword'});

    return await dio
        .put('${ApiEndpoints.USER}/$accountId',
            queryParameters: {'profile': 5}, data: body)
        .then((value) => true);
  } on Exception catch (e) {
    throw HttpHelper.decodeErrorResponse(e,
        tag: TAG,
        logger: logger,
        defaultErrorMessage: 'Failed to reset password',
        meta: {'user': accountId});
  }
}