add console.log
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-02-20 13:35:50 +01:00
parent c69679e204
commit 0b240e7925
2 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,6 @@ module.exports = Self => {
try { try {
const invoiceOut = await Self.findById(id, null, myOptions); const invoiceOut = await Self.findById(id, null, myOptions);
const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions); const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions);
console.log(hasInvoicing);
console.log(invoiceOut); console.log(invoiceOut);
if (invoiceOut.hasPdf && !hasInvoicing) if (invoiceOut.hasPdf && !hasInvoicing)
throw new UserError(`You don't have enough privileges`); throw new UserError(`You don't have enough privileges`);

View File

@ -65,6 +65,7 @@ describe('InvoiceOut filter()', () => {
await invoiceOut.updateAttribute('hasPdf', true, options); await invoiceOut.updateAttribute('hasPdf', true, options);
const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options); const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options);
console.log(result);
expect(result.length).toEqual(1); expect(result.length).toEqual(1);