Datentypen in Prod DB vorbereiten für release #69

Merged
PxlLoewe merged 56 commits from staging into release 2025-07-18 20:05:13 +00:00
Showing only changes of commit 959ae37213 - Show all commits

View File

@@ -23,9 +23,26 @@ export async function getData(
? { ? {
OR: [ OR: [
formattedId ? { id: formattedId } : undefined, formattedId ? { id: formattedId } : undefined,
...searchFields.map((field) => ({ ...searchFields.map((field) => {
[field]: { contains: searchTerm }, if (field.includes(".")) {
})), const parts: string[] = field.split(".");
// Helper function to build nested object
const buildNestedFilter = (parts: string[], index = 0): any => {
if (index === parts.length - 1) {
// Reached the last part - add the contains filter
return { [parts[index] as string]: { contains: searchTerm } };
}
// For intermediate levels, nest the next level
return { [parts[index] as string]: buildNestedFilter(parts, index + 1) };
};
return buildNestedFilter(parts);
}
return { [field]: { contains: searchTerm } };
}),
].filter(Boolean), ].filter(Boolean),
...filter, ...filter,
} }