stub out export endpoint
This commit is contained in:
8
mod.ts
8
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') {
|
||||
|
||||
Reference in New Issue
Block a user