Skip to content

Commit

Permalink
fix: Query signatures server using milliseconds instead of seconds (#100
Browse files Browse the repository at this point in the history
)

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.
   */
```
  • Loading branch information
LautaroPetaccio committed Oct 17, 2023
1 parent e2c3800 commit 18ded22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/modules/api/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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[] = []
Expand Down
1 change: 0 additions & 1 deletion src/modules/rentals/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export async function createRentalsComponent(components: {
},
}
)

if (!response.ok) {
let parsedErrorResult: SignaturesServerErrorResponse<any> | undefined
try {
Expand Down

0 comments on commit 18ded22

Please sign in to comment.