diff --git a/src/api/arm.ts b/src/api/arm.ts index c370912..85d6013 100644 --- a/src/api/arm.ts +++ b/src/api/arm.ts @@ -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 }) => { + let startDate = dayjs(date).startOf('day').toISOString(); + let 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) {