From 35a2a716026e27c2f1fbdc6ac2439e08c217c87f Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 14 Oct 2021 16:16:00 +0200 Subject: [PATCH] refactor(sales): transaction correctly passed to findById --- .../ticket/back/methods/ticket/transferSales.js | 2 +- package-lock.json | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/ticket/back/methods/ticket/transferSales.js b/modules/ticket/back/methods/ticket/transferSales.js index e196b7c19..49529135c 100644 --- a/modules/ticket/back/methods/ticket/transferSales.js +++ b/modules/ticket/back/methods/ticket/transferSales.js @@ -170,7 +170,7 @@ module.exports = Self => { // Update original sale const rest = originalSale.quantity - sale.quantity; - const originalInstance = await models.Sale.findById(sale.id, options); + const originalInstance = await models.Sale.findById(sale.id, null, options); await originalInstance.updateAttribute('quantity', rest, options); // Clone sale with new quantity diff --git a/package-lock.json b/package-lock.json index e1a4831b0..645c55238 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5655,6 +5655,7 @@ }, "node_modules/devtools-protocol": { "version": "0.0.847576", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.847576.tgz", "integrity": "sha512-0M8kobnSQE0Jmly7Mhbeq0W/PpZfnuK+WjN2ZRVPbGqYwCHCioAVp84H0TcLimgECcN5H976y5QiXMGBC9JKmg==" }, "node_modules/diff": { @@ -16896,6 +16897,7 @@ }, "node_modules/puppeteer": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-7.1.0.tgz", "integrity": "sha512-lqOLzqCKdh7yUAHvK6LxgOpQrL8Bv1/jvS8MLDXxcNms2rlM3E8p/Wlwc7efbRZ0twxTzUeqjN5EqrTwxOwc9g==", "hasInstallScript": true, "dependencies": { @@ -21105,8 +21107,9 @@ } }, "node_modules/unbzip2-stream": { - "version": "1.4.3", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", + "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", "dependencies": { "buffer": "^5.2.1", "through": "^2.3.8" @@ -21114,6 +21117,7 @@ }, "node_modules/unbzip2-stream/node_modules/buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { @@ -27925,6 +27929,7 @@ }, "devtools-protocol": { "version": "0.0.847576", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.847576.tgz", "integrity": "sha512-0M8kobnSQE0Jmly7Mhbeq0W/PpZfnuK+WjN2ZRVPbGqYwCHCioAVp84H0TcLimgECcN5H976y5QiXMGBC9JKmg==" }, "diff": { @@ -36716,6 +36721,7 @@ }, "puppeteer": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-7.1.0.tgz", "integrity": "sha512-lqOLzqCKdh7yUAHvK6LxgOpQrL8Bv1/jvS8MLDXxcNms2rlM3E8p/Wlwc7efbRZ0twxTzUeqjN5EqrTwxOwc9g==", "requires": { "debug": "^4.1.0", @@ -40017,8 +40023,9 @@ } }, "unbzip2-stream": { - "version": "1.4.3", - "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz", + "integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==", "requires": { "buffer": "^5.2.1", "through": "^2.3.8" @@ -40026,6 +40033,7 @@ "dependencies": { "buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "requires": { "base64-js": "^1.3.1",