getProductGroupsByRankingId method

Future<List<ProductGroup>> getProductGroupsByRankingId(
  1. String id
)

Gets all the product groups of the ranking that matches an id.

Implementation

Future<List<ProductGroup>> getProductGroupsByRankingId(String id) async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/rankings/$id/productgroups'),
  );

  ClientException.checkIsSuccessStatusCode(response);

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