Skip to content

Commit 0e6b43b

Browse files
author
MinjiK
committed
remove unnecessary changes
1 parent 316873a commit 0e6b43b

File tree

1 file changed

+8
-11
lines changed
  • src/amadeus/namespaces/shopping/flight_offers

1 file changed

+8
-11
lines changed

src/amadeus/namespaces/shopping/flight_offers/pricing.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)