From 70c3a61103ea095f5d7835ec6e2822d6b0771197 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 19 Jan 2023 14:36:32 +0100 Subject: [PATCH] add: createunits --- index.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.php b/index.php index fda4685..b172924 100644 --- a/index.php +++ b/index.php @@ -68,4 +68,11 @@ $app->post("/createingredients", function (array $req, Response $res) use ($db) $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(); \ No newline at end of file