diff --git a/services/nginx/app/routes/ordersRoute.php b/services/nginx/app/routes/ordersRoute.php index 5b499e8c..59067fa2 100644 --- a/services/nginx/app/routes/ordersRoute.php +++ b/services/nginx/app/routes/ordersRoute.php @@ -47,37 +47,7 @@ class ordersRoute $response->error('Invalid session', 400); } }); - - //TODO: Remove this route, as it is not used - $this->get('/orders/pending', function () { - // Require the user to be logged in - global $response; - $this->requirePermission('list_orders_pending'); - // Get the user object - $user = (new authentication())->get_user(); - // Check if the request was successful - if ($user) { - // Log the incident - (new logs_o())->add('orders', 'global', 1, $user->id, 'LIST_ORDERS_PENDING', 'Successfully listed pending orders'); - // Create orders object - $orders = new orders_o(); - // Return the list of orders that have not been invoiced - $response->success( - $orders->listPendingOrders( - function ($order) { - // Check if the order - /** @var array $order */ - return $order; - } - ) - ); - } else { - // Log the incident - (new logs_o())->add('orders', 'global', 1, 0, 'LIST_ORDERS_PENDING', 'No user found, or invalid session'); - // Return an error - $response->error('Invalid session', 400); - } - }); + $this->post('/orders', function () { // Require the user to be logged in