add second layer of result validation

This commit is contained in:
KS Jannette
2026-02-24 12:56:18 -05:00
parent d55f58985b
commit b7757ca406
12 changed files with 472 additions and 26 deletions

View File

@@ -23,8 +23,8 @@ router.get('/', async (req, res) => {
router.post('/cluster', async (req, res) => {
try {
const notes = await loadNotes();
const clusters = await clusterNotes(notes);
res.json(clusters);
const result = await clusterNotes(notes);
res.json(result);
} catch (err) {
console.error(`Clustering failed: ${err}`);
res.status(500).json({ error: 'Clustering failed' });