Codex changes
This commit is contained in:
parent
0bae902e08
commit
d4dde21ad2
46 changed files with 4953 additions and 966 deletions
|
|
@ -122,6 +122,16 @@ export function buildPropertySearchUrls({
|
|||
? (tenureFilter as string[])
|
||||
: [];
|
||||
|
||||
const habitableRoomsFilter = filters['Number of bedrooms & living rooms'];
|
||||
const minBedrooms =
|
||||
Array.isArray(habitableRoomsFilter) && typeof habitableRoomsFilter[0] === 'number'
|
||||
? Math.max(0, habitableRoomsFilter[0] - 1)
|
||||
: undefined;
|
||||
const maxBedrooms =
|
||||
Array.isArray(habitableRoomsFilter) && typeof habitableRoomsFilter[1] === 'number'
|
||||
? Math.max(0, habitableRoomsFilter[1] - 1)
|
||||
: undefined;
|
||||
|
||||
// Rightmove — requires locationIdentifier from typeahead API
|
||||
let rightmove: string | null = null;
|
||||
if (rightmoveLocationId) {
|
||||
|
|
@ -134,6 +144,8 @@ export function buildPropertySearchUrls({
|
|||
rmParams.set('minPrice', String(snapToAllowed(minPrice, RIGHTMOVE_PRICES, 'floor')));
|
||||
if (maxPrice !== undefined)
|
||||
rmParams.set('maxPrice', String(snapToAllowed(maxPrice, RIGHTMOVE_PRICES, 'ceil')));
|
||||
if (minBedrooms !== undefined) rmParams.set('minBedrooms', String(minBedrooms));
|
||||
if (maxBedrooms !== undefined) rmParams.set('maxBedrooms', String(maxBedrooms));
|
||||
if (selectedTypes.length > 0) {
|
||||
const rmTypes = [
|
||||
...new Set(
|
||||
|
|
@ -161,6 +173,8 @@ export function buildPropertySearchUrls({
|
|||
otmParams.set('min-price', String(snapToAllowed(minPrice, OTM_PRICES, 'floor')));
|
||||
if (maxPrice !== undefined)
|
||||
otmParams.set('max-price', String(snapToAllowed(maxPrice, OTM_PRICES, 'ceil')));
|
||||
if (minBedrooms !== undefined) otmParams.set('min-bedrooms', String(minBedrooms));
|
||||
if (maxBedrooms !== undefined) otmParams.set('max-bedrooms', String(maxBedrooms));
|
||||
if (selectedTypes.length > 0) {
|
||||
const otmTypes = [
|
||||
...new Set(selectedTypes.map((t) => PROPERTY_TYPE_MAP[t]?.onthemarket).filter(Boolean)),
|
||||
|
|
@ -181,6 +195,8 @@ export function buildPropertySearchUrls({
|
|||
zParams.set('price_min', String(snapToAllowed(minPrice, ZOOPLA_PRICES, 'floor')));
|
||||
if (maxPrice !== undefined)
|
||||
zParams.set('price_max', String(snapToAllowed(maxPrice, ZOOPLA_PRICES, 'ceil')));
|
||||
if (minBedrooms !== undefined) zParams.set('beds_min', String(minBedrooms));
|
||||
if (maxBedrooms !== undefined) zParams.set('beds_max', String(maxBedrooms));
|
||||
if (selectedTypes.length > 0) {
|
||||
const zTypes = [
|
||||
...new Set(selectedTypes.map((t) => PROPERTY_TYPE_MAP[t]?.zoopla).filter(Boolean)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue