deleteSavedScans method

  1. @override
Future<Either<Failure, Success>> deleteSavedScans(
  1. String token,
  2. String id
)
override

Implementation

@override
Future<Either<Failure, Success>> deleteSavedScans(
    String token, String id) async {
  try {
    final headers = {
      'Content-Type': 'application/json',
    };
    dio.options.headers['Authorization'] =
        'Bearer $token'; // replace <your-access-token> with your actual token
    final options = Options(headers: headers);
    var response = await dio.delete(
      "$valorUrl/saved-scanns/delete/$id",
      options: options,
    );
    if (response.statusCode == 200) {
      return Right(DataDeletionSuccess());
    } else {
      return Left(DataDeletionFailure());
    }
  } catch (e) {
    _sentryUtil.captureException(e);
    return Left(ServiceFailure());
  }
}