diff --git a/api/routes/rules.php b/api/routes/rules.php index 83b1d1e..251e946 100644 --- a/api/routes/rules.php +++ b/api/routes/rules.php @@ -105,4 +105,24 @@ ]; $response = $response->withJSON($response_json); return $response; +}); + +$app->post('/rules/saveBatch/{catId}', function($request, $response) { + // $theRules = json_decode($request->getParam("batchObj")); + // $cat = $request->getAttribute('catId'); + // foreach ($theRules as $r): + // $rule = new CategoryRankNutrient; + // $rule->findPk($r['ruleId']; + // $rule->setThreshold($r['threshold']); + // $rule->setUnits($r['units'])); + // $rule->setOperator($r['operator']); + // $rule->setCategoryId($cat); + // $rule->setRankId($r['rankId']); + // $rule->setNutrientId($r['nutrientId']); + // $rule->save(); + // endforeach; + +print_r($request); + + }); \ No newline at end of file