Skip to content

Commit

Permalink
im a moron
Browse files Browse the repository at this point in the history
  • Loading branch information
jsalisbury committed Mar 3, 2017
1 parent be403cc commit 8ec2f9f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions api/routes/nutrient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
$app->get('/nutrient/all', function( $request, $response ) {
$q = new NutrientQuery;
$nuts = $q::create()->find();

$response_json = [
"status" => [
"code" => $response->getStatusCode(),
"message" => "OK"
],
"data" => []
];
//[strtolower($rule->getRank()->getName())][$rule->getNutrient()->getName()]
foreach( $nuts as $nut ) {
$response_json["data"][] = [
"id" => $nut->getId(),
"name" => $nut->getName(),
];

}

$response = $response->withJSON($response_json);
return $response;

});

0 comments on commit 8ec2f9f

Please sign in to comment.