Removed PDF creation on download
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-10-01 08:11:26 +02:00
parent 26df12a70a
commit a41ae85226
2 changed files with 1 additions and 5 deletions

View File

@ -28,7 +28,7 @@ module.exports = Self => {
Self.createPdf = async function(ctx, id, options) {
const models = Self.app.models;
const headers = ctx.req.headers;
const origin = headers.origin || headers.referer;
const origin = headers.origin;
const authorization = ctx.req.accessToken.id;
if (process.env.NODE_ENV == 'test')

View File

@ -56,10 +56,6 @@ module.exports = Self => {
const fileName = `${year}${invoiceOut.ref}.pdf`;
const fileSrc = path.join(src, fileName);
// Creates PDF document if it has not been created
if (!invoiceOut.hasPdf || !fs.existsSync(fileSrc))
await Self.createPdf(ctx, invoiceOut.id, myOptions);
const file = {
path: fileSrc,
contentType: 'application/pdf',