fix: ensures no duplicate tax lines when completing cart (#1262)
* fix: ensures that no duplicate tax lines are created when completing cart
This commit is contained in:
1 parent
497e9b3f7d
commit
607a382b4e
9 files changed
+269
-16
No files matched your search
@@ -158,12 +158,18 @@ class BaseService {
|
||||
* @param {string} isolation - the isolation level to be used for the work.
|
||||
* @return {any} the result of the transactional work
|
||||
*/
|
||||
async atomicPhase_(work, isolationOrErrorHandler, maybeErrorHandler) {
|
||||
let errorHandler = maybeErrorHandler
|
||||
async atomicPhase_(
|
||||
work,
|
||||
isolationOrErrorHandler,
|
||||
maybeErrorHandlerOrDontFail
|
||||
) {
|
||||
let errorHandler = maybeErrorHandlerOrDontFail
|
||||
let isolation = isolationOrErrorHandler
|
||||
let dontFail = false
|
||||
if (typeof isolationOrErrorHandler === "function") {
|
||||
isolation = null
|
||||
errorHandler = isolationOrErrorHandler
|
||||
dontFail = !!maybeErrorHandlerOrDontFail
|
||||
}
|
||||
|
||||
if (this.transactionManager_) {
|
||||
@@ -226,8 +232,12 @@ class BaseService {
|
||||
return result
|
||||
} catch (error) {
|
||||
if (errorHandler) {
|
||||
await errorHandler(error)
|
||||
const result = await errorHandler(error)
|
||||
if (dontFail) {
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user