Skip to content

Commit 804bcb8

Browse files
committed
removed helper for flexibility
1 parent b997ff1 commit 804bcb8

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

spec/amadeus/namespaces.test.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,7 @@ describe('Namespaces', () => {
452452
amadeus.client.post = jest.fn();
453453
amadeus.booking.hotelOrders.post();
454454
expect(amadeus.client.post)
455-
.toHaveBeenCalledWith('/v2/booking/hotel-orders', JSON.stringify({
456-
data: {
457-
type: 'hotel-order',
458-
guests: [],
459-
travelAgent: {},
460-
roomAssociations: [],
461-
payment: {},
462-
arrivalInformation: {}
463-
}
464-
}));
455+
.toHaveBeenCalledWith('/v2/booking/hotel-orders', {});
465456
});
466457

467458
it('.amadeus.eReputation.hotelSentiments.get', () => {

src/amadeus/namespaces/booking/hotel_orders.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,16 @@ class HotelOrders {
2727
* ```js
2828
* amadeus.booking.hotelOrders.post({
2929
* 'guests': [],
30-
* 'travel_agent: {},
31-
* 'room_associations: [],
30+
* 'travelAgent: {},
31+
* 'roomAssociations: [],
3232
* 'payment': {},
3333
* 'arrivalInformation': {}
3434
* });
3535
* ```
3636
*/
3737
post(params = {}) {
38-
const body = {
39-
data: {
40-
type: 'hotel-order',
41-
guests: params.guests || [],
42-
travelAgent: params.travelAgent || {},
43-
roomAssociations: params.roomAssociations || [],
44-
payment: params.payment || {},
45-
arrivalInformation: params.arrivalInformation || {}
46-
}
47-
};
4838

49-
return this.client.post('/v2/booking/hotel-orders', JSON.stringify(body));
39+
return this.client.post('/v2/booking/hotel-orders', params);
5040
}
5141
}
5242

0 commit comments

Comments
 (0)