Initial commit: Angular frontend and Expressjs backend
This commit is contained in:
10
worklenz-backend/src/shared/safe-controller-function.ts
Normal file
10
worklenz-backend/src/shared/safe-controller-function.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import {NextFunction, Request, Response} from "express";
|
||||
import {IWorkLenzResponse} from "../interfaces/worklenz-response";
|
||||
|
||||
export default (fn: (_req: Request, _res: Response, next: NextFunction) => Promise<IWorkLenzResponse | void>)
|
||||
|
||||
: (req: Request, res: Response, next: NextFunction) => void => {
|
||||
return (req: Request, res: Response, next: NextFunction): void => {
|
||||
void fn(req, res, next);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user