getMySavedScans method

  1. @override
Future<Either<Failure, List<MyLogModel>>> getMySavedScans(
  1. String accessToken
)
override

Implementation

@override
Future<Either<Failure, List<MyLogModel>>> getMySavedScans(
    String accessToken) async {
  try {
    final headers = {
      'Content-Type': 'application/json',
    };
    dio.options.headers['Authorization'] =
        'Bearer $accessToken'; // replace <your-access-token> with your actual token
    final options = Options(headers: headers);
    var response = await dio.get(
      "$valorUrl/saved-scanns/list",
      options: options,
    );
    List<MyLogModel> savedScans = (response.data as List)
        .map((json) => MyLogModel.fromJson(json as Map<String, dynamic>))
        .toList();
    return Right(savedScans);
  } catch (e) {
    _sentryUtil.captureException(e);
    return Left(ServiceFailure());
  }
}