Skip to content

Commit

Permalink
Axios returns a response with a data key, not body,
Browse files Browse the repository at this point in the history
bump version
  • Loading branch information
officert committed Jun 13, 2017
1 parent dfcd3b0 commit b33f011
Show file tree
Hide file tree
Showing 28 changed files with 103 additions and 103 deletions.
2 changes: 1 addition & 1 deletion lib/client/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getEventsApi(key) {
return Promise.resolve(v204.post('/events', data, {
params
}))
.then(response => response.body);
.then(response => response.data);
},
/**
* @param {Object} [data]
Expand Down
4 changes: 2 additions & 2 deletions lib/client/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function getLabelsApi(key) {
return Promise.resolve(v204.post(`/users/${userId}/labels`, data, {
params
}))
.then(response => response.body);
.then(response => response.data);
},
/**
* @param {String} userId
Expand All @@ -37,7 +37,7 @@ function getLabelsApi(key) {
return Promise.resolve(v204.delete(`/users/${userId}/labels`, {
params
}))
.then(response => response.body);
.then(response => response.data);
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion lib/client/score.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getScoreApi(key) {
return Promise.resolve(v204.get(`/users/${userId}/score`, {
params
}))
.then(response => response.body);
.then(response => response.data);
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-siftscience",
"version": "0.0.6",
"version": "0.0.7",
"description": "Node HTTP client for Sift Science's API",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/addItemToCart-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.addItemToCart()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.addItemToCart(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/addPromotion-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.addPromotion()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.addPromotion(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/chargeback-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.chargeback()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.chargeback(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/contentStatus-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.contentStatus()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.contentStatus(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
12 changes: 6 additions & 6 deletions tests/siftScience/client/events/create-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.create()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -63,7 +63,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -75,7 +75,7 @@ describe('siftScience', () => {
return siftScienceClient.events.create(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -100,7 +100,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -112,7 +112,7 @@ describe('siftScience', () => {
return siftScienceClient.events.create(data, params)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/createAccount-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.createAccount()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.createAccount(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/createContent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.createContent()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.createContent(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/createOrder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.createOrder()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.createOrder(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
8 changes: 4 additions & 4 deletions tests/siftScience/client/events/flagContent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -45,7 +45,7 @@ describe('siftScience', () => {
return siftScienceClient.events.flagContent()
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand All @@ -64,7 +64,7 @@ describe('siftScience', () => {
let postStub;

let response = {
body: {}
data: {}
};

before('stub v204.post()', () => {
Expand All @@ -76,7 +76,7 @@ describe('siftScience', () => {
return siftScienceClient.events.flagContent(data)
.then(result => {
should.exist(result);
result.should.deepEqual(response.body);
result.should.deepEqual(response.data);

postStub.callCount.should.equal(1);
postStub.args[0][0].should.equal('/events');
Expand Down
Loading

0 comments on commit b33f011

Please sign in to comment.