Skip to content

Commit bfe7faf

Browse files
committed
adding debugging
1 parent 32a790f commit bfe7faf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api/src/routes/authorities.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ authoritiesRouter.post("/bulk-pdf", ReturnValidationErrors, async (req: Request,
117117

118118
let allItemData = "";
119119

120+
console.log("Generating bulk PDF for IDs:", idList);
121+
120122
for (let id of idList) {
121123
let item = await loadSingleAuthority(req, id);
122124

125+
console.log("Processing ID:", id, "Found item:", !!item);
126+
123127
if (item) {
124128
(item as any).API_PORT = API_PORT;
125129

@@ -141,6 +145,9 @@ authoritiesRouter.post("/bulk-pdf", ReturnValidationErrors, async (req: Request,
141145
allItemData += data + '<div style="page-break-after: always;"></div>';
142146
}
143147
}
148+
149+
console.log("Generating final PDF document", allItemData);
150+
144151
let pdf = await generatePDF(allItemData);
145152
res.setHeader("Content-disposition", `attachment; filename="FormB_BULKPRINT.pdf"`);
146153
res.setHeader("Content-type", "application/pdf");

0 commit comments

Comments
 (0)