Skip to content

Commit

Permalink
Merge pull request #82 from gatewayapps/feature/user-location-codes
Browse files Browse the repository at this point in the history
added location code id to user accounts
  • Loading branch information
danielgary authored May 29, 2018
2 parents 5cb3ea1 + 2a53c39 commit c5f8ed9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ims-shared-core",
"version": "10.1.3",
"version": "11.0.0",
"description": "",
"babel": {
"presets": [
Expand Down
4 changes: 4 additions & 0 deletions src/hub/db/userAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ module.exports = (Sequelize, dbContext) => {
userStatusId: {
type: Sequelize.INTEGER,
allowNull: true
},
locationCodeId: {
type: Sequelize.INTEGER,
allowNull: true
}
}, {
tableName: 'UserAccounts',
Expand Down
6 changes: 3 additions & 3 deletions src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function getAccessTokenForPackage (packageId) {
return pkg.accessToken
} else {
console.error('Package not present in accessTokens', accessTokens)
return undefined
}
}

Expand All @@ -154,7 +155,8 @@ function makeAuthenticatedRequest (url, requestOptions) {

return makeRequest(combineUrlParts(pkg.url, url), requestOptions)
} else {
throw new Error(`Package ${requestOptions.packageId} was not found in ${accessTokens} Make sure you have added the package to your packageDependencies`)
return Promise.resolve({ success: false, message: `An access token could not be obtained for ${requestOptions.packageId}` })
// throw new Error(`Package ${requestOptions.packageId} was not found in ${accessTokens} Make sure you have added the package to your packageDependencies`)
}
}
}
Expand All @@ -163,8 +165,6 @@ function makeUnauthenticatedRequest (url, requestOptions) {
}

function makeRequest (url, requestOptions) {
console.log('making request to ', url)
console.log('with options ', JSON.stringify(requestOptions, null, 2))
return fetch(url, requestOptions).then(parseResponse)
}
export function parseResponse (response) {
Expand Down

0 comments on commit c5f8ed9

Please sign in to comment.