@@ -12,9 +12,12 @@ export class PdfController {
|
||||
|
||||
@Post('/contracts')
|
||||
@OpenAPI({ description: "Generate Sponsoring contract pdfs from runner objects." })
|
||||
async generateContracts(@Body({ validate: true }) runner: Runner, @Res() res: any, @QueryParam("locale") locale: string) {
|
||||
const contracts = await this.pdf.generateSponsoringContract(runner, locale);
|
||||
async generateContracts(@Body({ validate: true }) runners: Runner | Runner[], @Res() res: any, @QueryParam("locale") locale: string) {
|
||||
if (!Array.isArray(runners)) {
|
||||
runners = [runners]
|
||||
}
|
||||
const contracts = await this.pdf.generateSponsoringContract(runners, locale);
|
||||
res.setHeader('content-type', 'application/pdf');
|
||||
return await contracts;
|
||||
return contracts;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user