deleteDevice method
Implementation
@override
Future<bool> deleteDevice(String deviceId, {bool hardDelete=false}) async {
try {
if (hardDelete) {
return await dio
.delete('${ApiEndpoints.DEVICES}/$deviceId?type=hard')
.then((value) => true);
}
else {
return await dio
.delete('${ApiEndpoints.DEVICES}/$deviceId')
.then((value) => true);
}
} on Exception catch (e) {
throw HttpHelper.decodeErrorResponse(e,
tag: TAG,
logger: logger,
defaultErrorMessage: 'Failed to delete device',
meta: {'id': deviceId, 'method': 'deleteDevice'});
}
}