@@ -8,7 +8,7 @@ const { PDFDocument, rgb, StandardFonts } = require('pdf-lib');
router.get('/pdf/:type/:id', function (req, res, next) {
(async function () {
let type = req.params.type;
- if (type != 'page' || type != 'work') throw new Error(`Not Support URL`);
+ if (type != 'page' && type != 'work') throw new Error(`Not Support URL`);
let id = req.params.id;
utils.validators.validateId(id);
@@ -169,7 +169,7 @@
async function printImage(id) {
try {
- const response = await fetch(`/download/pdf/${id}`);
+ const response = await fetch(`/download/pdf/page/${id}`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);