3671-supplier_account #889

Merged
carlosjr merged 5 commits from 3671-supplier_account into dev 2022-03-04 08:59:38 +00:00
1 changed files with 1 additions and 2 deletions
Showing only changes of commit 6748426f67 - Show all commits

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)
alexm marked this conversation as resolved
Review

Self explanatory code doesn't need comments

Self explanatory code doesn't need comments
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);
alexm marked this conversation as resolved
Review

The "options" argument should be used as third argument as described on:
https://apidocs.loopback.io/loopback/#persistedmodel-findbyid

Second argument should be the filter object or null if not needed

The "options" argument should be used as third argument as described on: https://apidocs.loopback.io/loopback/#persistedmodel-findbyid Second argument should be the filter object or null if not needed
if (supplier.isPayMethodChecked)
await supplier.updateAttribute('isPayMethodChecked', false, options);