Skip to content

Commit

Permalink
Fixed issue with createQuoteExtension (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vassilis Barzokas authored May 22, 2020
1 parent e25fe98 commit 1e1cd38
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
27 changes: 20 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "quoting-service",
"description": "Quoting Service hosted by a scheme",
"license": "Apache-2.0",
"version": "10.2.1",
"version": "10.2.2",
"author": "ModusBox",
"contributors": [
"James Bush <[email protected]>",
Expand Down Expand Up @@ -60,12 +60,12 @@
"dependencies": {
"@hapi/good": "9.0.0",
"@hapi/hapi": "18.4.1",
"@mojaloop/central-services-error-handling": "10.2.1",
"@mojaloop/central-services-error-handling": "10.2.2",
"@mojaloop/central-services-logger": "9.5.1",
"@mojaloop/central-services-shared": "10.2.0",
"@mojaloop/event-sdk": "9.5.2",
"@mojaloop/ml-number": "8.2.0",
"@mojaloop/sdk-standard-components": "10.2.3",
"@mojaloop/sdk-standard-components": "10.2.4",
"axios": "0.19.2",
"blipp": "4.0.1",
"eslint-config-standard": "14.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/data/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ class Database {
* @returns {object}
* @param {Array[{object}]} extensions - array of extension objects with quoteId, key and value properties
*/
async createQuoteExtensions (txn, extensions, quoteId, transactionId, quoteResponseId = undefined) {
async createQuoteExtensions (txn, extensions, quoteId, transactionId = undefined, quoteResponseId = undefined) {
try {
const newExtensions = extensions.map(({ key, value }) => ({
quoteId,
Expand Down
3 changes: 1 addition & 2 deletions src/model/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,7 @@ class QuotesModel {
if (quoteUpdateRequest.extensionList &&
Array.isArray(quoteUpdateRequest.extensionList.extension)) {
refs.extensions = await this.db.createQuoteExtensions(
txn, quoteUpdateRequest.extensionList.extension, quoteId, quoteUpdateRequest.transactionId,
refs.quoteResponseId)
txn, quoteUpdateRequest.extensionList.extension, quoteId, null, refs.quoteResponseId)
}

// todo: create any additional quoteParties e.g. for fees, comission etc...
Expand Down
2 changes: 1 addition & 1 deletion test/unit/model/quotes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ describe('QuotesModel', () => {
mockTransaction,
mockData.quoteUpdate.extensionList.extension,
mockData.quoteId,
mockData.transactionId,
null,
mockQuoteResponseId
)

Expand Down

0 comments on commit 1e1cd38

Please sign in to comment.