Skip to content

Commit

Permalink
feat: revert the getBooleanValue change
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Aug 5, 2024
1 parent 2f1d431 commit 2878839
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
16 changes: 10 additions & 6 deletions src/adapters/handlers/prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ export function createPricesHandler(
const params = new Params(context.url.searchParams)
const category = params.getString('category') as PriceFilterCategory
const assetType = params.getString('assetType') as AssetType
const isWearableHead = params.getBooleanValue('isWearableHead')
const isWearableAccessory = params.getBooleanValue('isWearableAccessory')
const isWearableSmart = params.getBooleanValue('isWearableSmart')
const isWearableHead = params.getBoolean('isWearableHead')
? params.getString('isWearableAccessory') === 'true'
: undefined
const isWearableAccessory = params.getBoolean('isWearableAccessory')
? params.getString('isWearableAccessory') === 'true'
: undefined
const isWearableSmart = params.getBoolean('isWearableSmart')
const wearableCategory = params.getValue<WearableCategory>(
'wearableCategory',
WearableCategory
Expand All @@ -51,13 +55,13 @@ export function createPricesHandler(
const itemRarities = params.getList<Rarity>('itemRarity', Rarity)
const network = params.getValue<Network>('network', Network)

const adjacentToRoad = params.getBooleanValue('adjacentToRoad')
const adjacentToRoad = params.getBoolean('adjacentToRoad')
const minDistanceToPlaza = params.getNumber('minDistanceToPlaza')
const maxDistanceToPlaza = params.getNumber('maxDistanceToPlaza')
const maxEstateSize = params.getNumber('maxEstateSize')
const minEstateSize = params.getNumber('minEstateSize')
const emoteHasSound = params.getBooleanValue('emoteHasSound')
const emoteHasGeometry = params.getBooleanValue('emoteHasGeometry')
const emoteHasSound = params.getBoolean('emoteHasSound')
const emoteHasGeometry = params.getBoolean('emoteHasGeometry')

return asJSON(
async () => ({
Expand Down
5 changes: 0 additions & 5 deletions src/logic/http/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ export class Params {
return value !== null
}

getBooleanValue(key: string) {
const value = this.params.get(key)
return value !== null ? value === 'true' : undefined
}

getValue<T extends string>(
key: string,
values: Values = {},
Expand Down

0 comments on commit 2878839

Please sign in to comment.