Files
directus/api/src/middleware/schema.ts
2021-02-11 18:14:55 -05:00

11 lines
330 B
TypeScript

import { RequestHandler } from 'express';
import asyncHandler from '../utils/async-handler';
import { getSchema } from '../utils/get-schema';
const schema: RequestHandler = asyncHandler(async (req, res, next) => {
req.schema = await getSchema({ accountability: req.accountability });
return next();
});
export default schema;