File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
src/amadeus/namespaces/shopping/flight_offers Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -39,19 +39,16 @@ class Pricing {
3939 * ```
4040 */
4141 post ( params = { } , additionalParams = { } ) {
42- // Check if params is an array
43- if ( Array . isArray ( params ) ) {
44- // If it is, wrap it in the required structure
45- params = {
46- 'data' : {
47- 'type' : 'flight-offers-pricing' ,
48- 'flightOffers' : params
49- }
50- } ;
51- }
5242 // Convert additionalParams object to query string
5343 const queryString = Object . keys ( additionalParams ) . map ( key => key + '=' + additionalParams [ key ] ) . join ( '&' ) ;
54- return this . client . post ( '/v1/shopping/flight-offers/pricing?' + queryString , params ) ;
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 ) ;
5552 }
5653}
5754
You can’t perform that action at this time.
0 commit comments