refs #5995 Requested changes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2023-09-18 10:03:31 +02:00
parent 979315aa5e
commit 6c34421413
3 changed files with 7 additions and 9 deletions

View File

@ -185,5 +185,6 @@
"You don't have enough privileges.": "You don't have enough privileges.",
"This ticket is locked.": "This ticket is locked.",
"This ticket is not editable.": "This ticket is not editable.",
"The ticket doesn't exist.": "The ticket doesn't exist."
"The ticket doesn't exist.": "The ticket doesn't exist.",
"The response is not a PDF": "The response is not a PDF"
}

View File

@ -315,5 +315,6 @@
"This ticket is not editable.": "Este ticket no es editable.",
"The ticket doesn't exist.": "No existe el ticket.",
"Social name should be uppercase": "La razón social debe ir en mayúscula",
"Street should be uppercase": "La dirección fiscal debe ir en mayúscula"
"Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
"The response is not a PDF": "La respuesta no es un PDF"
}

View File

@ -55,14 +55,10 @@ module.exports = Self => {
responseType: 'arraybuffer',
});
if (response.headers['content-type'] !== 'application/pdf') {
throw new UserError(`The response for cmr id ${id} is not a PDF.`);
}
if (response.headers['content-type'] !== 'application/pdf')
throw new UserError(`The response is not a PDF`);
const pdfData = response.data;
const fileName = `${id}.pdf`;
zip.file(fileName, pdfData, { binary: true });
zip.file(`${id}.pdf`, response.data, { binary: true });
}
const zipStream = zip.generateNodeStream({ streamFiles: true });