Removed PDF creation on download
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
26df12a70a
commit
a41ae85226
|
@ -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')
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue