You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below code there are 3 db transactions, one for before, one for updation and another one for fetching the updated data post the update transaction, i feel this can be reduced to two considering we have the before value and the update value, we can make a union of the two values, this has performance impact on the application.
Considering negative scenarios of unwanted values, the update operation should be sufficient enough invalidate those values.
async updateById(
id: ID,
data: DataObject<M>,
options?: AuditOptions,
): Promise<void> {
if (options?.noAudit) {
return super.updateById(id, data, options);
}
const before = await this.findById(id);
// loopback repository internally calls updateAll so we don't want to create another log
if (options) {
options.noAudit = true;
} else {
options = {noAudit: true};
}
await super.updateById(id, data, options);
const after = await this.findById(id);
The text was updated successfully, but these errors were encountered:
Describe the bug
In the below code there are 3 db transactions, one for before, one for updation and another one for fetching the updated data post the update transaction, i feel this can be reduced to two considering we have the before value and the update value, we can make a union of the two values, this has performance impact on the application.
Considering negative scenarios of unwanted values, the update operation should be sufficient enough invalidate those values.
The text was updated successfully, but these errors were encountered: