feat: add a component for changing days (#48)
This commit is contained in:
@@ -8,8 +8,14 @@ enum ArmEndpoints {
|
||||
const armService = () => {
|
||||
const endpoint = getConfigValue('dry-wash.api');
|
||||
|
||||
const fetchOrders = async () => {
|
||||
const response = await fetch(`${endpoint}${ArmEndpoints.ORDERS}`);
|
||||
const fetchOrders = async ({ date }: { date: Date }) => {
|
||||
const response = await fetch(`${endpoint}${ArmEndpoints.ORDERS}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ date }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch orders: ${response.status}`);
|
||||
|
||||
Reference in New Issue
Block a user