From 9f776d3fb0de01c44ca7b6efcdbcf89655a6ac3f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 7 Aug 2023 06:51:26 -0300 Subject: [PATCH] fix date query parameter --- packages/merchant-backoffice-ui/src/hooks/backend.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/merchant-backoffice-ui/src/hooks/backend.ts b/packages/merchant-backoffice-ui/src/hooks/backend.ts index 90fd320a9..145a366f6 100644 --- a/packages/merchant-backoffice-ui/src/hooks/backend.ts +++ b/packages/merchant-backoffice-ui/src/hooks/backend.ts @@ -239,16 +239,16 @@ export function useBackendInstanceRequest(): useBackendInstanceRequestType { searchDate?: Date, delta?: number, ): Promise> { - const date_ms = + const date_s = delta && delta < 0 && searchDate - ? searchDate.getTime() + 1 - : searchDate?.getTime(); + ? (searchDate.getTime() / 1000) + 1 + : searchDate !== undefined ? (searchDate.getTime() / 1000) : undefined; const params: any = {}; if (paid !== undefined) params.paid = paid; if (delta !== undefined) params.delta = delta; if (refunded !== undefined) params.refunded = refunded; if (wired !== undefined) params.wired = wired; - if (date_ms !== undefined) params.date_ms = date_ms; + if (date_s !== undefined) params.date_s = date_s; return requestHandler(baseUrl, endpoint, { params, token }); }, [baseUrl, token],