diff --git a/spec/amadeus/namespaces.test.js b/spec/amadeus/namespaces.test.js index 9860229..b8d794c 100644 --- a/spec/amadeus/namespaces.test.js +++ b/spec/amadeus/namespaces.test.js @@ -452,16 +452,7 @@ describe('Namespaces', () => { amadeus.client.post = jest.fn(); amadeus.booking.hotelOrders.post(); expect(amadeus.client.post) - .toHaveBeenCalledWith('/v2/booking/hotel-orders', JSON.stringify({ - data: { - type: 'hotel-order', - guests: [], - travelAgent: {}, - roomAssociations: [], - payment: {}, - arrivalInformation: {} - } - })); + .toHaveBeenCalledWith('/v2/booking/hotel-orders', {}); }); it('.amadeus.eReputation.hotelSentiments.get', () => { diff --git a/src/amadeus/namespaces/booking/hotel_orders.js b/src/amadeus/namespaces/booking/hotel_orders.js index aa5f5a9..ba34045 100644 --- a/src/amadeus/namespaces/booking/hotel_orders.js +++ b/src/amadeus/namespaces/booking/hotel_orders.js @@ -27,26 +27,16 @@ class HotelOrders { * ```js * amadeus.booking.hotelOrders.post({ * 'guests': [], - * 'travel_agent: {}, - * 'room_associations: [], + * 'travelAgent: {}, + * 'roomAssociations: [], * 'payment': {}, * 'arrivalInformation': {} * }); * ``` */ post(params = {}) { - const body = { - data: { - type: 'hotel-order', - guests: params.guests || [], - travelAgent: params.travelAgent || {}, - roomAssociations: params.roomAssociations || [], - payment: params.payment || {}, - arrivalInformation: params.arrivalInformation || {} - } - }; - return this.client.post('/v2/booking/hotel-orders', JSON.stringify(body)); + return this.client.post('/v2/booking/hotel-orders', params); } }