diff --git a/src/public/app/nav.html b/src/public/app/nav.html index a2598b5d..b66acffc 100644 --- a/src/public/app/nav.html +++ b/src/public/app/nav.html @@ -74,7 +74,7 @@ group_add Upload - + save_as Save Credentials diff --git a/src/routes/files.ts b/src/routes/files.ts index 8f9d295a..f906caf7 100644 --- a/src/routes/files.ts +++ b/src/routes/files.ts @@ -20,7 +20,7 @@ export default async function files(fastify: FastifyInstance) { return stringify([columns]); }); - fastify.get('/files/credentials', async (req) => { + fastify.get('/files/credentials', async (req, reply) => { const sessionCache: SessionCache = req.sessionCache; const results = new Map(); const places = sessionCache.getPlaces(); @@ -37,7 +37,6 @@ export default async function files(fastify: FastifyInstance) { result.push(record); results.set(place.type, result); }); - const zip = new JSZip(); results.forEach((places, contactType) => { const parent = Config.getParentProperty(contactType); @@ -56,7 +55,7 @@ export default async function files(fastify: FastifyInstance) { }) ); }); - + reply.header('Content-Disposition', `attachment; filename="${Date.now()}_${req.chtSession.authInfo.friendly}_users.zip"`) return zip.generateNodeStream(); }); }