unshare method

Future<void> unshare(
  1. List<String> nodeIds,
  2. String email
)

Unshares nodes with another user.

Takes list of node ids to share and a single email to share them with.

Implementation

Future<void> unshare(List<String> nodeIds, String email) async {
  final uri = _urlBase.getPath(_nodeSharing, {
    'nodes': nodeIds.reduce((value, element) => '$value,$element'),
    'email': email,
  });

  final resp = await delete(
    uri,
    headers: {
      URLBase.authHeader: accessToken,
    },
  );
  final Map<String, dynamic> bodyResp =
      await JsonIsolate().decodeJson(resp.body);
  if (resp.statusCode != 200) {
    throw bodyResp['description'];
  }
}