UsersController::edit(); }); $routes->get('/tuotteet/kebabit', function () { ProductController::get_products('Kebab'); }); $routes->get('/tuotteet/juomat', function () { ProductController::get_products('Juoma'); }); $routes->get('/tuotteet/pizzat', function () { ProductController::get_products('Pizza'); }); $routes->get('/tuotteet/salaatit', function () { ProductController::get_products('Salaatti'); }); $routes->get('/tuotteet/:category/lisaa', 'check_logged_in', 'check_if_admin', function ($category) { ProductController::add_form($category); }); $routes->post('/tuotteet/:category/lisaa', 'check_logged_in', 'check_if_admin', function () { ProductController::add(); }); $routes->get('/tuotteet/:category/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($category, $id) { ProductController::edit_form($id); }); $routes->post('/tuotteet/:category/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($category, $id) { ProductController::edit($id); }); $routes->post('/tuotteet/:id/poista', 'check_logged_in', 'check_if_admin', function ($id) { ProductController::delete($id); }); $routes->get('/ainesosat', 'check_logged_in', 'check_if_admin', function () { IngredientController::get_ingredients();