Renamed editMetadata to match V1 naming. Added Operations controller
This commit is contained in:
27
server-node/src/utils/endpoint-utils.ts
Normal file
27
server-node/src/utils/endpoint-utils.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
import express, { Request, Response } from 'express';
|
||||
|
||||
export function respondWithBinaryPdf(res: Response, buffer: Uint8Array, filename: string) {
|
||||
res.writeHead(200, {
|
||||
'Content-Type': "application/pdf",
|
||||
'Content-disposition': 'attachment;filename=' + filename,
|
||||
'Content-Length': buffer.length
|
||||
});
|
||||
res.end(buffer)
|
||||
}
|
||||
|
||||
export function response_mustHaveExactlyOneFile(res: Response): void {
|
||||
res.status(400).send([
|
||||
{
|
||||
"message": "file is required",
|
||||
"path": [
|
||||
"pdfFile"
|
||||
],
|
||||
"type": "file",
|
||||
"context": {
|
||||
"label": "pdfFile",
|
||||
"key": "pdfFile"
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user