isOTPEnabled method

  1. @override
Future<Either<AppException, Response>> isOTPEnabled({
  1. required String user,
})
override

Implementation

@override
Future<Either<AppException, response.Response>> isOTPEnabled(
    {required String user}) async {
  try {
    final eitherType = await networkService.get(
      'check-otp-option',
      queryParameters: {
        'name': user,
      },
    );
    return eitherType.fold(
      (exception) {
        return Left(exception);
      },
      (response) {
        return Right(response);
      },
    );
  } catch (e) {
    return Left(
      AppException(
        message: 'Unknown error occured',
        statusCode: 1,
        identifier: '${e.toString()}\nLoginUserRemoteDataSource.loginUser',
      ),
    );
  }
}