This commit is contained in:
parent
b6e993dadf
commit
32429a58e0
|
@ -44,7 +44,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const invoiceOut = await Self.findById(id, null, myOptions);
|
||||
const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions);
|
||||
console.log(invoiceOut, !hasInvoicing);
|
||||
|
||||
if (invoiceOut.hasPdf && !hasInvoicing)
|
||||
throw new UserError(`You don't have enough privileges`);
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ module.exports = Self => {
|
|||
ids = ids.split(',');
|
||||
|
||||
for (let id of ids) {
|
||||
console.log(zipConfig, totalSize, zipConfig ? zipConfig.maxSize : null);
|
||||
if (zipConfig && totalSize > zipConfig.maxSize) throw new UserError('Files are too large');
|
||||
const invoiceOutPdf = await models.InvoiceOut.download(ctx, id, myOptions);
|
||||
const fileName = extractFileName(invoiceOutPdf[2]);
|
||||
|
|
|
@ -65,7 +65,6 @@ describe('InvoiceOut filter()', () => {
|
|||
await invoiceOut.updateAttribute('hasPdf', true, options);
|
||||
|
||||
const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options);
|
||||
console.log(result);
|
||||
|
||||
expect(result.length).toEqual(1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue