feat: resource tables printing

This commit is contained in:
Ahmed Bouhuolia
2024-06-02 13:15:56 +02:00
parent 79be4266bb
commit f15fecde54
11 changed files with 52 additions and 43 deletions

View File

@@ -26,7 +26,6 @@ export class ExportController extends BaseController {
],
this.validationResult,
this.export.bind(this),
this.catchServiceErrors
);
return router;
}
@@ -85,26 +84,4 @@ export class ExportController extends BaseController {
next(error);
}
}
/**
* Transforms service errors to response.
* @param {Error}
* @param {Request} req
* @param {Response} res
* @param {ServiceError} error
*/
private catchServiceErrors(
error,
req: Request,
res: Response,
next: NextFunction
) {
if (error instanceof ServiceError) {
return res.status(400).send({
errors: [{ type: error.errorType }],
});
}
next(error);
}
}