Files
Compass/lib/client/fetching.ts
2025-08-04 14:25:33 +02:00

15 lines
425 B
TypeScript

export async function fetchFeatures(setAllFeatures: any) {
// results = []
try {
const res = await fetch('/api/interests');
if (res.ok) {
const data = await res.json();
for (const [id, values] of Object.entries(data)) {
setAllFeatures(id, values || []);
// results.push({id, values});
}
}
} catch (error) {
console.error('Error fetching feature options:', error);
}
}