getChannelsByNodeId method

Future<List<Channel>> getChannelsByNodeId(
  1. int id
)

Gets all the channels of the node that matches an id.

Implementation

Future<List<Channel>> getChannelsByNodeId(int id) async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/nodes/$id/channels'),
  );

  ClientException.checkIsSuccessStatusCode(response);

  return (json.decode(response.body) as List)
      .map((e) => Channel.fromJson(e))
      .toList();
}