From 18ded22a675a86c15517848d4ce034e56bc63757 Mon Sep 17 00:00:00 2001 From: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:37:11 -0300 Subject: [PATCH] fix: Query signatures server using milliseconds instead of seconds (#100) As the JSDoc says, the server admits a date in milliseconds and we're querying the server using seconds. ``` /** Gets the updated rental listings that were updated after the given date. * @param updatedAfter A UTC timestamp in milliseconds of the rental listings update time. * @throws An error if the request fails. */ ``` --- src/modules/api/component.ts | 10 +++++++--- src/modules/rentals/component.ts | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/api/component.ts b/src/modules/api/component.ts index 20800c5..b114979 100644 --- a/src/modules/api/component.ts +++ b/src/modules/api/component.ts @@ -18,7 +18,10 @@ import { TileRentalListing, } from '../../adapters/rentals' import { isRentalListingOpen } from '../../logic/rental' -import { fromMillisecondsToSeconds } from '../../adapters/time' +import { + fromMillisecondsToSeconds, + fromSecondsToMilliseconds, +} from '../../adapters/time' import { Metrics } from '../../metrics' import { Tile, TileType } from '../map/types' import { coordsToId, specialTiles } from '../map/utils' @@ -274,8 +277,9 @@ export async function createApiComponent(components: { } }` ) - const updatedRentalListings = - rentals.getUpdatedRentalListings(updatedAfter) + const updatedRentalListings = rentals.getUpdatedRentalListings( + fromSecondsToMilliseconds(updatedAfter) + ) let parcels: ParcelFragment[] = [] let estates: EstateFragment[] = [] diff --git a/src/modules/rentals/component.ts b/src/modules/rentals/component.ts index 420fb61..a47205c 100644 --- a/src/modules/rentals/component.ts +++ b/src/modules/rentals/component.ts @@ -41,7 +41,6 @@ export async function createRentalsComponent(components: { }, } ) - if (!response.ok) { let parsedErrorResult: SignaturesServerErrorResponse | undefined try {