updateNode method

Future<Node> updateNode(
  1. String id,
  2. NodeUpdate nodeUpdate
)

Updates a node's pathHash or content

Implementation

Future<Node> updateNode(String id, NodeUpdate nodeUpdate) async {
  return _repository.update(id, (current) {
    return current.copyWith(
      pathHash: nodeUpdate.pathHash ?? current.pathHash,
      content: nodeUpdate.content?.toMap() ?? current.contentMap,
    );
  });
}