Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 0d4b6d2

Browse files
authored
Merge release-v0.1.8 into master
2 parents 25d2a92 + d9eae6d commit 0d4b6d2

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.1.8 (May 7, 2019)
2+
- Update `Fault` model to have `arguments` property. [#18](https://github.com/mobify/commercecloud-ocapi-client/pull/18)
3+
14
## v0.1.7 (February 5, 2019)
25
- Add relevant properties to `VariationAttributeValue` model and some others. [#15](https://github.com/mobify/commercecloud-ocapi-client/pull/15)
36

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commercecloud-ocapi-client",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "An ES6 JavaScript Client for Salesforce Open Commerce API",
55
"license": "SEE LICENSE IN LICENSE",
66
"main": "dist/commercecloud-ocapi-client.cjs.js",

src/models/Fault.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export default class Fault {
4141
* @member {String} type
4242
*/
4343
this.type = undefined
44+
45+
/**
46+
* These are optional arguments returned with fault
47+
* @member {Object} arguments
48+
*/
49+
this.arguments = undefined
4450
}
4551

4652
/**
@@ -62,6 +68,9 @@ export default class Fault {
6268
if (data.hasOwnProperty('type')) {
6369
obj['type'] = ApiClient.convertToType(data['type'], 'String')
6470
}
71+
if (data.hasOwnProperty('arguments')) {
72+
obj['arguments'] = ApiClient.convertToType(data['arguments'], {String: Object})
73+
}
6574
}
6675

6776
return obj

test/api/StoresApi.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ describe('StoresApi', () => {
7575
expect(store.constructor.name).to.be('Store')
7676
})
7777
)
78+
79+
it('should throw Fault when calling getStoresByID with unknown store id', () => {
80+
instance.getStoresByID('badstoreid')
81+
.catch((fault) => {
82+
expect(fault.constructor.name).to.be('Fault')
83+
console.log('fault: ', fault)
84+
})
85+
})
7886
})
7987

8088
describe('getStoresByIDs', () => {

0 commit comments

Comments
 (0)