correct loopback form
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-03-03 13:48:18 +01:00
parent 29d63d1e4d
commit 6748426f67
1 changed files with 1 additions and 2 deletions

View File

@ -38,10 +38,9 @@ module.exports = Self => {
Self.observe('after save', async ctx => {
const options = {};
// Check for transactions
if (ctx.options && ctx.options.transaction)
options.transaction = ctx.options.transaction;
const supplier = await Self.app.models.Supplier.findById(ctx.instance.supplierFk, options);
const supplier = await Self.app.models.Supplier.findById(ctx.instance.supplierFk, null, options);
if (supplier.isPayMethodChecked)
await supplier.updateAttribute('isPayMethodChecked', false, options);