Skip to content

Commit

Permalink
post method support JSON.springify
Browse files Browse the repository at this point in the history
  • Loading branch information
MinjiK committed Dec 5, 2023
1 parent 8ab506d commit c35e09a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/amadeus/namespaces/booking/flight_orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FlightOrders {
* ```
*/
post(params = {}) {
return this.client.post('/v1/booking/flight-orders', params);
return this.client.post('/v1/booking/flight-orders', JSON.stringify(params));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/amadeus/namespaces/ordering/transfer_orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TransferOrders {
* ```
*/
post(body, offerId) {
return this.client.post(`/v1/ordering/transfer-orders?offerId=${offerId}`, body);
return this.client.post(`/v1/ordering/transfer-orders?offerId=${offerId}`, JSON.stringify(body));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* ```js
* let amadeus = new Amadeus();
* amadeus.ordering.transferOrder('XXX').transfers.cancellation.post(JSON.stringify({}), 12345);;
* amadeus.ordering.transferOrder('XXX').transfers.cancellation.post({}, '12345');;
* ```
*
* @param {Client} client
Expand All @@ -24,12 +24,12 @@ class Cancellation {
* To cancel a transfer order with ID 'XXX' and confirmation number '12345'
*
* ```js
* amadeus.ordering.transferOrder('XXX').transfers.cancellation.post(JSON.stringify({}), 12345);;
* amadeus.ordering.transferOrder('XXX').transfers.cancellation.post({}, '12345');;
* ```
*/
post(body, confirmNbr) {
return this.client.post(
`/v1/ordering/transfer-orders/${this.orderId}/transfers/cancellation?confirmNbr=${confirmNbr}`, body);
`/v1/ordering/transfer-orders/${this.orderId}/transfers/cancellation?confirmNbr=${confirmNbr}`, JSON.stringify(body));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FlightAvailabilities {
* ```
*/
post(params = {}) {
return this.client.post('/v1/shopping/availability/flight-availabilities', params);
return this.client.post('/v1/shopping/availability/flight-availabilities', JSON.stringify(params));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/amadeus/namespaces/shopping/flight_offers/upselling.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Upselling {
* ```
*/
post(params = {}) {
return this.client.post('/v1/shopping/flight-offers/upselling', params);
return this.client.post('/v1/shopping/flight-offers/upselling', JSON.stringify(params));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/amadeus/namespaces/shopping/flight_offers_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class FlightOffersSearch {
* To do a customized search with given options.
*
* ```js
* amadeus.shopping.flightOffersSearch.post (JSON.stringify({
* amadeus.shopping.flightOffersSearch.post ({
"currencyCode": "USD",
"originDestinations": [
{
Expand Down Expand Up @@ -114,11 +114,11 @@ class FlightOffersSearch {
}
}
}
}))
})
* ```
*/
post(params = {}) {
return this.client.post('/v2/shopping/flight-offers', params);
return this.client.post('/v2/shopping/flight-offers',JSON.stringify(params));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/amadeus/namespaces/shopping/seatmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class Seatmaps {
* departureDate: '2020-08-01'
* }).then(function(response){
* return amadeus.shopping.flightOffers.seatmaps.post(
* JSON.stringify({
* {
* 'data': response.data
* })
* }
* );
* });
* ```
*/
post(params = {}) {
return this.client.post('/v1/shopping/seatmaps', params);
return this.client.post('/v1/shopping/seatmaps', JSON.stringify(params));
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/amadeus/namespaces/shopping/transfer_offers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TransferOffers {
* ```
*/
post(params = {}) {
return this.client.post('/v1/shopping/transfer-offers', params);
return this.client.post('/v1/shopping/transfer-offers', JSON.stringify(params));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/amadeus/namespaces/travel/trip_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TripParser {
* ```
*/
post(params = {}) {
return this.client.post('/v3/travel/trip-parser', params);
return this.client.post('/v3/travel/trip-parser', JSON.stringify(params));
}
/**
* Helper method to convert file contents in UTF-8 encoded string
Expand Down

0 comments on commit c35e09a

Please sign in to comment.