Skip to content

Commit 2eaad08

Browse files
committed
Fix hotels to use correct paths
1 parent 76d3f30 commit 2eaad08

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 1.0.0.beta2 - 2018-03-28
4+
5+
Update singular endpoints to use singular names.
6+
7+
For example:
8+
9+
```sh
10+
GET /v1/shopping/hotels/SMPARCOL/hotel-offers
11+
```
12+
13+
becomes
14+
15+
```js
16+
amadeus.shopping.hotel('SMPARCOL').hotelOffers.get()
17+
```
18+
319
## 1.0.0-beta1 - 2018-03-27
420

521
* First Beta release with support for all the initial API endpoints

spec/amadeus/namespaces.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ describe('Namespaces', () => {
131131
amadeus.client.get = jest.fn();
132132
amadeus.shopping.hotel(123).hotelOffers.get();
133133
expect(amadeus.client.get)
134-
.toHaveBeenCalledWith('/v1/shopping/hotel/123/hotel-offers', {});
134+
.toHaveBeenCalledWith('/v1/shopping/hotels/123/hotel-offers', {});
135135
});
136136

137137
it('.amadeus.shopping.hotel(123).offer(234).get', () => {
138138
amadeus.client.get = jest.fn();
139139
amadeus.shopping.hotel(123).offer(234).get();
140140
expect(amadeus.client.get)
141-
.toHaveBeenCalledWith('/v1/shopping/hotel/123/offers/234', {});
141+
.toHaveBeenCalledWith('/v1/shopping/hotels/123/offers/234', {});
142142
});
143143
});
144144
});

src/amadeus/namespaces/shopping/hotel/hotel_offers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class HotelHotelOffers {
2727
* Search for hotel offers for hotel with ID 123
2828
*
2929
* ```js
30-
* amadeus.hotel(123).hotelOffers.get();
30+
* amadeus.hotel('SMPARCOL').hotelOffers.get();
3131
* ```
3232
*/
3333
get(params = {}) {
34-
return this.client.get(`/v1/shopping/hotel/${this.hotelId}/hotel-offers`, params);
34+
return this.client.get(`/v1/shopping/hotels/${this.hotelId}/hotel-offers`, params);
3535
}
3636
}
3737

src/amadeus/namespaces/shopping/hotel/offer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class Offer {
2929
* Search for hotel offers for hotel with ID 123
3030
*
3131
* ```js
32-
* amadeus.hotels(123).offers(234).get();
32+
* amadeus.hotel('SMPARCOL').offer('AC7D4DA2C322A73AF0824318A4965DA2805A3FC2').get();
3333
* ```
3434
*/
3535
get(params = {}) {
3636
return this.client.get(
37-
`/v1/shopping/hotel/${this.hotelId}/offers/${this.offerId}`, params
37+
`/v1/shopping/hotels/${this.hotelId}/offers/${this.offerId}`, params
3838
);
3939
}
4040
}

0 commit comments

Comments
 (0)