getProductAllergensByAllergenId method

Future<List<ProductAllergen>> getProductAllergensByAllergenId(
  1. String id
)

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

Implementation

Future<List<ProductAllergen>> getProductAllergensByAllergenId(
    String id) async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/allergens/$id/productallergens'),
  );

  ClientException.checkIsSuccessStatusCode(response);

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