do what we can

This commit is contained in:
2025-12-07 22:41:33 -06:00
parent ca95d296b5
commit 0d6abeb287
3 changed files with 75 additions and 26 deletions
+3 -1
View File
@@ -19,7 +19,9 @@ app.get('/api/health', (req, res) => res.json({ ok: true, ts: new Date().toISOSt
// main endpoint — run the uploader flow (download workbook if env vars exist, create folders and upload PDF)
app.post('/api/upload-managers', async (req, res) => {
try {
const result = await run();
// Accept records from request body (sent from Excel add-in)
const records = req.body && req.body.records ? req.body.records : null;
const result = await run(records);
res.json({ ok: true, result });
} catch (err) {
console.error('Error in /api/upload-managers', err);