refactor: replace let for const
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-04-12 12:44:46 +02:00
parent 1e11191e79
commit ad3b3c44d6
2 changed files with 4 additions and 8 deletions

View File

@ -21,15 +21,13 @@ module.exports = Self => {
Self.deleteSalesClaimed = async(ctx, sales, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
const tx = await Self.beginTransaction({});
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
if (!myOptions.transaction)
myOptions.transaction = tx;
}
try {
const promises = [];

View File

@ -24,16 +24,14 @@ module.exports = Self => {
});
Self.updateClaimDestination = async(rows, claimDestinationFk, options) => {
let tx;
const tx = await Self.beginTransaction({});
const myOptions = {};
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
if (!myOptions.transaction)
myOptions.transaction = tx;
}
try {
const models = Self.app.models;