Compare commits
3 Commits
feature/up
...
06abc15c9a
| Author | SHA1 | Date | |
|---|---|---|---|
| 06abc15c9a | |||
| 6ca7de9467 | |||
| 939f107d1c |
@@ -1,4 +1,5 @@
|
||||
import { getConfigValue } from '@brojs/cli';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
enum ArmEndpoints {
|
||||
ORDERS = '/arm/orders',
|
||||
@@ -9,12 +10,15 @@ const armService = () => {
|
||||
const endpoint = getConfigValue('dry-wash.api');
|
||||
|
||||
const fetchOrders = async ({ date }: { date: Date }) => {
|
||||
const startDate = dayjs(date).startOf('day').toISOString();
|
||||
const endDate = dayjs(date).endOf('day').toISOString();
|
||||
|
||||
const response = await fetch(`${endpoint}${ArmEndpoints.ORDERS}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ date }),
|
||||
body: JSON.stringify({ startDate, endDate }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user