Removed number from property.
All checks were successful
thehideout/TheHideout-API/pipeline/head This commit looks good
All checks were successful
thehideout/TheHideout-API/pipeline/head This commit looks good
This commit is contained in:
parent
f39c8c1981
commit
86bd0b7fc8
@ -92,6 +92,15 @@ export async function storeProperties(env, properties) {
|
||||
|
||||
export async function transformSmoobuProperty(env, property) {
|
||||
console.log("Transforming property:", property.id);
|
||||
let street = property.location?.street || "";
|
||||
// Remove leading number and whitespace if present
|
||||
street = street.replace(/^\d+\s*/, "");
|
||||
// Split by commas and join with newlines
|
||||
street = street
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.join("\n");
|
||||
|
||||
return {
|
||||
smoobuId: property.id,
|
||||
name: property.name || "Unknown Property",
|
||||
@ -107,7 +116,7 @@ export async function transformSmoobuProperty(env, property) {
|
||||
queenSizeBeds: property.rooms?.queenSizeBeds || 0,
|
||||
kingSizeBeds: property.rooms?.kingSizeBeds || 0,
|
||||
address: property.location
|
||||
? `${property.location.street || ""}\n${property.location.city || ""}\n${
|
||||
? `${street || ""}\n${property.location.city || ""}\n${
|
||||
property.location.zip || ""
|
||||
}`.trim()
|
||||
: "Unknown Address",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user