fix ordering, remove parameters
parent
4e59ebe8ad
commit
0a4d54a150
|
|
@ -1,4 +1,4 @@
|
||||||
/// <reference types="cookie-parser" />
|
/// <reference types="cookie-parser" />
|
||||||
import type { Request, Response, NextFunction } from 'express';
|
import type { NextFunction, Request, Response } from 'express';
|
||||||
export declare function handler(request: Request, response: Response, next: NextFunction): Promise<void>;
|
export declare function handler(request: Request, response: Response, next: NextFunction): Promise<void>;
|
||||||
export default handler;
|
export default handler;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import camelcase from 'camelcase';
|
||||||
import * as ejs from 'ejs';
|
import * as ejs from 'ejs';
|
||||||
import * as configFunctions from '../../helpers/functions.config.js';
|
import * as configFunctions from '../../helpers/functions.config.js';
|
||||||
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js';
|
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js';
|
||||||
import { getReportData, getPdfPrintConfig } from '../../helpers/functions.print.js';
|
import { getPdfPrintConfig, getReportData } from '../../helpers/functions.print.js';
|
||||||
const attachmentOrInline = configFunctions.getProperty('settings.printPdf.contentDisposition');
|
const attachmentOrInline = configFunctions.getProperty('settings.printPdf.contentDisposition');
|
||||||
export async function handler(request, response, next) {
|
export async function handler(request, response, next) {
|
||||||
const printName = request.params.printName;
|
const printName = request.params.printName;
|
||||||
|
|
@ -40,9 +40,6 @@ export async function handler(request, response, next) {
|
||||||
format: 'letter',
|
format: 'letter',
|
||||||
printBackground: true,
|
printBackground: true,
|
||||||
preferCSSPageSize: true
|
preferCSSPageSize: true
|
||||||
}, undefined, {
|
|
||||||
cacheBrowser: true,
|
|
||||||
remoteContent: false
|
|
||||||
});
|
});
|
||||||
pdfCallbackFunction(pdf);
|
pdfCallbackFunction(pdf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,13 @@ import { convertHTMLToPDF } from '@cityssm/pdf-puppeteer'
|
||||||
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
import * as dateTimeFunctions from '@cityssm/utils-datetime'
|
||||||
import camelcase from 'camelcase'
|
import camelcase from 'camelcase'
|
||||||
import * as ejs from 'ejs'
|
import * as ejs from 'ejs'
|
||||||
import type { Request, Response, NextFunction } from 'express'
|
import type { NextFunction, Request, Response } from 'express'
|
||||||
|
|
||||||
import * as configFunctions from '../../helpers/functions.config.js'
|
import * as configFunctions from '../../helpers/functions.config.js'
|
||||||
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js'
|
import * as lotOccupancyFunctions from '../../helpers/functions.lotOccupancy.js'
|
||||||
import {
|
import {
|
||||||
getReportData,
|
getPdfPrintConfig,
|
||||||
getPdfPrintConfig
|
getReportData
|
||||||
} from '../../helpers/functions.print.js'
|
} from '../../helpers/functions.print.js'
|
||||||
|
|
||||||
const attachmentOrInline = configFunctions.getProperty(
|
const attachmentOrInline = configFunctions.getProperty(
|
||||||
|
|
@ -74,19 +74,11 @@ export async function handler(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const pdf = await convertHTMLToPDF(
|
const pdf = await convertHTMLToPDF(ejsData, {
|
||||||
ejsData,
|
format: 'letter',
|
||||||
{
|
printBackground: true,
|
||||||
format: 'letter',
|
preferCSSPageSize: true
|
||||||
printBackground: true,
|
})
|
||||||
preferCSSPageSize: true
|
|
||||||
},
|
|
||||||
undefined,
|
|
||||||
{
|
|
||||||
cacheBrowser: true,
|
|
||||||
remoteContent: false
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
pdfCallbackFunction(pdf)
|
pdfCallbackFunction(pdf)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue