mirror of
https://github.com/directus/directus.git
synced 2026-01-30 21:57:58 -05:00
check if export has been set, if not return
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user