Files
Compass/_old/lib/client/fetching.ts
MartinBraquet 14c12ffb08 Rename
2025-09-18 11:19:09 +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);
}
}