diff --git a/api/src/middleware/reponse-manager.ts b/api/src/middleware/reponse-manager.ts index 42b2395956..e00eb11c81 100644 --- a/api/src/middleware/reponse-manager.ts +++ b/api/src/middleware/reponse-manager.ts @@ -1,5 +1,6 @@ import { RequestHandler } from 'express'; import asyncHandler from 'express-async-handler'; +import fs from 'fs'; /** * middleware to manage actions on responses such as @@ -9,6 +10,18 @@ import asyncHandler from 'express-async-handler'; */ const responseManager: RequestHandler = asyncHandler(async (req, res, next) => { + if (!req.query.export) return next(); + + const exportType = req.query.export; + + if (exportType === 'json') { + // have chose to export json + } + + if (exportType === 'csv') { + // have chosen to export csv + } + return next(); });