refactor: replace let for const
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
1e11191e79
commit
ad3b3c44d6
|
@ -21,15 +21,13 @@ module.exports = Self => {
|
||||||
Self.deleteSalesClaimed = async(ctx, sales, options) => {
|
Self.deleteSalesClaimed = async(ctx, sales, options) => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
let tx;
|
const tx = await Self.beginTransaction({});
|
||||||
|
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
if (!myOptions.transaction) {
|
if (!myOptions.transaction)
|
||||||
tx = await Self.beginTransaction({});
|
|
||||||
myOptions.transaction = tx;
|
myOptions.transaction = tx;
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
|
@ -24,16 +24,14 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.updateClaimDestination = async(rows, claimDestinationFk, options) => {
|
Self.updateClaimDestination = async(rows, claimDestinationFk, options) => {
|
||||||
let tx;
|
const tx = await Self.beginTransaction({});
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
|
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
if (!myOptions.transaction) {
|
if (!myOptions.transaction)
|
||||||
tx = await Self.beginTransaction({});
|
|
||||||
myOptions.transaction = tx;
|
myOptions.transaction = tx;
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
|
|
Loading…
Reference in New Issue