Minor fixes.
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
b10247509a
commit
ccfa654016
11
src/utils/TheHideout-UI.code-workspace
Normal file
11
src/utils/TheHideout-UI.code-workspace
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "../../../TheHideout-UI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../.."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
||||||
@ -63,7 +63,7 @@ export async function addToNotionDataSource(
|
|||||||
} else if (key === "Features") {
|
} else if (key === "Features") {
|
||||||
notionProperties[key] = {
|
notionProperties[key] = {
|
||||||
multi_select: value.map((feature) => ({
|
multi_select: value.map((feature) => ({
|
||||||
name: feature.replace(/,/g, ";"),
|
name: feature,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
} else if (key === "Message" && value != "") {
|
} else if (key === "Message" && value != "") {
|
||||||
@ -188,7 +188,7 @@ export async function updateNotionPage(
|
|||||||
} else if (key === "Features") {
|
} else if (key === "Features") {
|
||||||
notionProperties[key] = {
|
notionProperties[key] = {
|
||||||
multi_select: value.map((feature) => ({
|
multi_select: value.map((feature) => ({
|
||||||
name: feature.replace(/,/g, ";"),
|
name: feature,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
} else if (typeof value === "string" && value != "") {
|
} else if (typeof value === "string" && value != "") {
|
||||||
|
|||||||
@ -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);
|
console.log("Transforming property:", property.id);
|
||||||
let street = property.location?.street || "";
|
let street = property.location?.street || "";
|
||||||
// Remove leading number and whitespace if present
|
// Remove leading number and whitespace if present
|
||||||
@ -121,7 +121,7 @@ export async function transformSmoobuProperty(env, property) {
|
|||||||
}`.trim()
|
}`.trim()
|
||||||
: "Unknown Address",
|
: "Unknown Address",
|
||||||
features:
|
features:
|
||||||
property.amenities.map((feature) => feature.replaceAll(",", ";")) || [],
|
property.amenities.map((feature) => feature.replace(/,/g, ";")) || [],
|
||||||
minPrice: property.price?.minimal ? parseFloat(property.price.minimal) : 0,
|
minPrice: property.price?.minimal ? parseFloat(property.price.minimal) : 0,
|
||||||
maxPrice: property.price?.maximal ? parseFloat(property.price.maximal) : 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 syncName = properties["Sync Name"]?.checkbox || false;
|
||||||
|
|
||||||
const features = properties["Features"]?.["multi_select"].map((feature) =>
|
const features = properties["Features"]?.["multi_select"].map((feature) =>
|
||||||
feature.name.replaceAll(",", ";")
|
feature.name.replace(/,/g, ";")
|
||||||
);
|
);
|
||||||
// Extract name from title
|
// Extract name from title
|
||||||
const name = properties.Name?.title?.[0]?.plain_text || "Untitled";
|
const name = properties.Name?.title?.[0]?.plain_text || "Untitled";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user