From ccfa6540166fe775a307616f130b9393da4a11c8 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sat, 3 Jan 2026 00:32:21 +0000 Subject: [PATCH] Minor fixes. --- src/utils/TheHideout-UI.code-workspace | 11 +++++++++++ src/utils/notion.js | 4 ++-- src/utils/properties.js | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 src/utils/TheHideout-UI.code-workspace diff --git a/src/utils/TheHideout-UI.code-workspace b/src/utils/TheHideout-UI.code-workspace new file mode 100644 index 0000000..916a47a --- /dev/null +++ b/src/utils/TheHideout-UI.code-workspace @@ -0,0 +1,11 @@ +{ + "folders": [ + { + "path": "../../../TheHideout-UI" + }, + { + "path": "../.." + } +], + "settings": {} +} diff --git a/src/utils/notion.js b/src/utils/notion.js index 2e3162b..2bd4c0b 100644 --- a/src/utils/notion.js +++ b/src/utils/notion.js @@ -63,7 +63,7 @@ export async function addToNotionDataSource( } else if (key === "Features") { notionProperties[key] = { multi_select: value.map((feature) => ({ - name: feature.replace(/,/g, ";"), + name: feature, })), }; } else if (key === "Message" && value != "") { @@ -188,7 +188,7 @@ export async function updateNotionPage( } else if (key === "Features") { notionProperties[key] = { multi_select: value.map((feature) => ({ - name: feature.replace(/,/g, ";"), + name: feature, })), }; } else if (typeof value === "string" && value != "") { diff --git a/src/utils/properties.js b/src/utils/properties.js index 0feea22..dea706d 100644 --- a/src/utils/properties.js +++ b/src/utils/properties.js @@ -90,7 +90,7 @@ export async function storeProperties(env, properties) { } } -export async function transformSmoobuProperty(env, property) { +export function transformSmoobuProperty(env, property) { console.log("Transforming property:", property.id); let street = property.location?.street || ""; // Remove leading number and whitespace if present @@ -121,7 +121,7 @@ export async function transformSmoobuProperty(env, property) { }`.trim() : "Unknown Address", features: - property.amenities.map((feature) => feature.replaceAll(",", ";")) || [], + property.amenities.map((feature) => feature.replace(/,/g, ";")) || [], minPrice: property.price?.minimal ? parseFloat(property.price.minimal) : 0, maxPrice: property.price?.maximal ? parseFloat(property.price.maximal) : 0, }; @@ -241,7 +241,7 @@ export async function transformNotionProperty(env, notionProperty) { const syncName = properties["Sync Name"]?.checkbox || false; const features = properties["Features"]?.["multi_select"].map((feature) => - feature.name.replaceAll(",", ";") + feature.name.replace(/,/g, ";") ); // Extract name from title const name = properties.Name?.title?.[0]?.plain_text || "Untitled";