Skip to content

Commit 4ce357f

Browse files
committed
fix(Client): respect callback argument for Submittable case
1 parent e55da72 commit 4ce357f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/pg/lib/client.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,12 @@ class Client extends EventEmitter {
511511
} else if (typeof config.submit === 'function') {
512512
readTimeout = config.query_timeout || this.connectionParameters.query_timeout
513513
result = query = config
514-
if (typeof values === 'function') {
515-
query.callback = query.callback || values
514+
if (!query.callback) {
515+
if (typeof values === 'function') {
516+
query.callback = values
517+
} else if (callback) {
518+
query.callback = callback
519+
}
516520
}
517521
} else {
518522
readTimeout = this.connectionParameters.query_timeout

0 commit comments

Comments
 (0)