Fetches all orders from the API.
This function sends a GET request to the API to retrieve all orders. If the request is successful, it returns the order data. In case of an error, it catches the error and logs it, returning an empty array.
getOrders
The response data from the API, which contains an array of orders, or an empty array if an error occurs.
If there is an error during the request, it is caught and logged.
Fetches all orders from the API.
This function sends a GET request to the API to retrieve all orders. If the request is successful, it returns the order data. In case of an error, it catches the error and logs it, returning an empty array.
getOrders