deleteSavedScans method
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());
}
}