File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
ordering/transfer_orders/transfers Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 66 *
77 * ```js
88 * let amadeus = new Amadeus();
9- * amadeus.ordering.transferOrder('XXX').transfers.cancellation.post(JSON.stringify({}), 12345);;
9+ * amadeus.ordering.transferOrder('XXX').transfers.cancellation.post(JSON.stringify({}), ' 12345' );;
1010 * ```
1111 *
1212 * @param {Client } client
@@ -24,7 +24,7 @@ class Cancellation {
2424 * To cancel a transfer order with ID 'XXX' and confirmation number '12345'
2525 *
2626 * ```js
27- * amadeus.ordering.transferOrder('XXX').transfers.cancellation.post(JSON.stringify({}), 12345);;
27+ * amadeus.ordering.transferOrder('XXX').transfers.cancellation.post(JSON.stringify({}), ' 12345' );;
2828 * ```
2929 */
3030 post ( body , confirmNbr ) {
Original file line number Diff line number Diff line change @@ -38,8 +38,17 @@ class Pricing {
3838 * });
3939 * ```
4040 */
41- post ( params = { } ) {
42- return this . client . post ( '/v1/shopping/flight-offers/pricing' , params ) ;
41+ post ( params = { } , additionalParams = { } ) {
42+ // Convert additionalParams object to query string
43+ const queryString = Object . keys ( additionalParams ) . map ( key => key + '=' + additionalParams [ key ] ) . join ( '&' ) ;
44+
45+ // Check if queryString is empty before appending it to the URL
46+ let url = '/v1/shopping/flight-offers/pricing' ;
47+ if ( queryString !== '' ) {
48+ url += '?' + queryString ;
49+ }
50+
51+ return this . client . post ( url , params ) ;
4352 }
4453}
4554
You can’t perform that action at this time.
0 commit comments