Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/recipe-fiddle.git
<?php
namespace com\whitemagicsoftware;

require "constants.php";
require "class.Ajax.php";

/**
 * Handles Ajax requests for ingredient groups.
 */
class AjaxIngredientGroup extends Ajax {
  function __construct() {
    parent::__construct();
  }

  public function handleAjaxRequest() {
    // Get the recipe ID from the JavaScript.
    $recipeId = $this->getParameterId( "recipe-id" );

    return $this->json( $this->call( "get_recipe_ingredient_group_list",
      "id, label", $recipeId ) );
  }
}