getProductGroupMealCategorisationsByProductGroupId method

Future<List<ProductGroupMealCategorisation>> getProductGroupMealCategorisationsByProductGroupId(
  1. int id
)

Gets all the product group meal categorisation information of the product that matches an id.

Implementation

Future<List<ProductGroupMealCategorisation>>
    getProductGroupMealCategorisationsByProductGroupId(int id) async {
  final response = await _context.client.get(
    Uri.https(
        authority, '$path/productgroups/$id/productgroupmealcategorisations'),
  );

  ClientException.checkIsSuccessStatusCode(response);

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