Added logic for generateing multiple contracts per runner

ref #35
This commit is contained in:
Nicolai Ort 2021-03-13 13:59:34 +01:00
parent b180e04045
commit d9919404b5
1 changed files with 5 additions and 0 deletions

View File

@ -108,6 +108,11 @@ export class PdfCreator {
if (runners.length == 1 && Object.keys(runners[0]).length == 0) {
runners[0] = this.generateEmptyRunner();
}
for (var i = 1; i < PdfCreator.contractsPerRunner; i++) {
runners = runners.reduce(function (res, current, index, array) {
return res.concat([current, current]);
}, []);
}
if (runners.length > 50) {
let pdf_promises = new Array<Promise<Buffer>>();
let i, j;