From b56dd344fc049c93c86122d4599a2eae44a6af04 Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Fri, 10 Apr 2026 01:26:55 -0400 Subject: [PATCH] stub out export endpoint --- mod.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod.ts b/mod.ts index 5b26838..36ebe5b 100644 --- a/mod.ts +++ b/mod.ts @@ -60,6 +60,14 @@ Deno.serve({ port: config.api.port }, async (req) => { return genericResponse(STATUS_CODE.OK, JSON.stringify(plans)); } else if (path.startsWith('/export/')) { + const userId = path.replace('/list/', ''); + const userMatch = await dbClient.query('SELECT id FROM users WHERE id = ?', [userId]).catch(() => { + failed = true; + }); + if (failed) return genericResponse(STATUS_CODE.InternalServerError, "Couldn't read DB."); + if (!userMatch.length) return genericResponse(STATUS_CODE.NotFound, 'User ID does not exist.'); + + // WIP: export plans to zip code goes here return genericResponse(STATUS_CODE.NotImplemented, 'WIP'); } } else if (req.method === 'POST' && path === '/enroll') {