mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-01-02 10:58:10 -05:00
15 lines
425 B
TypeScript
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);
|
|
}
|
|
} |