getProductDietsByDietId method

Future<List<ProductDiet>> getProductDietsByDietId(
  1. String id
)

Gets all the product diet information of the diet that matches an id.

Implementation

Future<List<ProductDiet>> getProductDietsByDietId(String id) async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/diets/$id/productdiets'),
  );

  ClientException.checkIsSuccessStatusCode(response);

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