Fixed barcode generation for runenrcard pdfs🐞
This commit is contained in:
@@ -38,7 +38,7 @@ export class PdfController {
|
||||
|
||||
@Post('/cards')
|
||||
@OpenAPI({ description: "Generate runner card pdfs from runner card objects.<br>You can choose your prefered locale by passing the 'locale' query-param." })
|
||||
async generateCards(@Body({ validate: true, options: { limit: "500mb" } }) cards: RunnerCard | RunnerCard[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("download") download: boolean) {
|
||||
async generateCards(@Body({ validate: true, options: { limit: "500mb" } }) cards: RunnerCard | RunnerCard[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("codeformat") codeformat: string, @QueryParam("download") download: boolean) {
|
||||
if (!this.initialized) {
|
||||
await this.pdf.init();
|
||||
this.initialized = true;
|
||||
@@ -47,7 +47,7 @@ export class PdfController {
|
||||
cards = [cards];
|
||||
}
|
||||
cards = this.mapCardGroupNames(cards);
|
||||
const contracts = await this.pdf.generateRunnerCards(cards, locale);
|
||||
const contracts = await this.pdf.generateRunnerCards(cards, locale, codeformat);
|
||||
res.setHeader('content-type', 'application/pdf');
|
||||
if (download) {
|
||||
res.setHeader('Content-Disposition', 'attachment; filename="cards.pdf"')
|
||||
|
||||
Reference in New Issue
Block a user