refs #6184 saveCmr #1788

Merged
guillermo merged 58 commits from 6184-saveCmr into dev 2024-02-13 06:47:06 +00:00
1 changed files with 0 additions and 6 deletions
Showing only changes of commit ce5a2ada62 - Show all commits

View File

@ -34,19 +34,13 @@ module.exports = Self => {
}); });
Self.generateCmrPdf = async function(ctx, id, options) { Self.generateCmrPdf = async function(ctx, id, options) {
const models = Self.app.models;
const myOptions = {}; const myOptions = {};
if (typeof options == 'object') if (typeof options == 'object')
Object.assign(myOptions, options); Object.assign(myOptions, options);
const zipConfig = await models.ZipConfig.findOne(null, myOptions);
let totalSize = 0;
const baseUrl = (await Self.app.models.Url.getUrl()).replace('#!', 'api'); const baseUrl = (await Self.app.models.Url.getUrl()).replace('#!', 'api');
if (zipConfig && totalSize > zipConfig.maxSize) throw new UserError('Files are too large');
const response = await axios.get( const response = await axios.get(
guillermo marked this conversation as resolved Outdated

totalSize per a que es gasta?

totalSize per a que es gasta?

Para nada, lo voy a quitar, ya no tiene sentido que esté ahí, bien visto

Para nada, lo voy a quitar, ya no tiene sentido que esté ahí, bien visto
`${baseUrl}Routes/${id}/cmr`, { `${baseUrl}Routes/${id}/cmr`, {
...myOptions, ...myOptions,