add: createunits

This commit is contained in:
Don Bock 2023-01-19 14:36:32 +01:00
parent 7c4ab54f45
commit 70c3a61103

View File

@ -68,4 +68,11 @@ $app->post("/createingredients", function (array $req, Response $res) use ($db)
$res->send("New ingredient has been listed "); $res->send("New ingredient has been listed ");
}); });
$app->post("/createunits", function (array $req, Response $res) use ($db) {
$newUnit = $req["body"]["unit"];
$db->insert("folla", ["unita" => "$newUnit"]);
$res->send("New unit has been listed ");
});
$app->start(); $app->start();