fix date query parameter

This commit is contained in:
Sebastian 2023-08-07 06:51:26 -03:00
parent 7d1621767c
commit 9f776d3fb0
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069

View File

@ -239,16 +239,16 @@ export function useBackendInstanceRequest(): useBackendInstanceRequestType {
searchDate?: Date,
delta?: number,
): Promise<HttpResponseOk<T>> {
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<T>(baseUrl, endpoint, { params, token });
},
[baseUrl, token],