3671-supplier_account #889
|
@ -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
|
||||
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
joan
commented
The "options" argument should be used as third argument as described on: 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);
|
||||
|
|
Loading…
Reference in New Issue
Self explanatory code doesn't need comments