@odynn/awayz-hotels 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useLocationSearch/useLocationSearch.js +10 -10
- package/dist/lib/components/HotelResult/HotelResult.types.d.ts +2 -2
- package/dist/lib/hooks/useHotelDetails/useHotelDetails.d.ts +1 -1
- package/dist/lib/main.d.ts +2 -1
- package/dist/lib/services/hotel/HotelService.types.d.ts +5 -4
- package/dist/lib/utilities/pointsAsCashUtils.d.ts +2 -1
- package/dist/services/hotel/HotelService.js +4 -4
- package/dist/utilities/pointsAsCashUtils.js +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useQuery as
|
|
2
|
-
import { HotelService as
|
|
3
|
-
const
|
|
4
|
-
const { data:
|
|
5
|
-
queryKey: ["locations",
|
|
6
|
-
queryFn: () =>
|
|
7
|
-
enabled: !!
|
|
1
|
+
import { useQuery as n } from "@tanstack/react-query";
|
|
2
|
+
import { HotelService as r } from "../../services/hotel/HotelService.js";
|
|
3
|
+
const l = (e) => {
|
|
4
|
+
const { data: o, isLoading: i } = n({
|
|
5
|
+
queryKey: ["locations", e],
|
|
6
|
+
queryFn: () => r.getLocations(e),
|
|
7
|
+
enabled: !!e
|
|
8
8
|
// Only run the query if searchInput is not empty
|
|
9
9
|
});
|
|
10
|
-
return {
|
|
11
|
-
locations: (
|
|
10
|
+
return console.log({ data: o }), {
|
|
11
|
+
locations: (o == null ? void 0 : o.data) || [],
|
|
12
12
|
loading: i
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
l as useLocationSearch
|
|
17
17
|
};
|
|
@@ -52,7 +52,7 @@ export interface IHotelDetails {
|
|
|
52
52
|
partners: IHotelPartner[];
|
|
53
53
|
hotelProgram: IHotelProgram;
|
|
54
54
|
bestValue: string;
|
|
55
|
-
pointsAsCash:
|
|
55
|
+
pointsAsCash: IHotelPointsAsCash;
|
|
56
56
|
imagesS3?: string[];
|
|
57
57
|
colour?: string;
|
|
58
58
|
distance: number;
|
|
@@ -80,7 +80,7 @@ export interface IHotelProgram {
|
|
|
80
80
|
stepBonus: IStepBonus;
|
|
81
81
|
valueCent: number;
|
|
82
82
|
}
|
|
83
|
-
export interface
|
|
83
|
+
export interface IHotelPointsAsCash {
|
|
84
84
|
pointsAsCashRequired: number;
|
|
85
85
|
pointsAsCashAvailable: number;
|
|
86
86
|
totalPointsUsed: number;
|
|
@@ -9,6 +9,6 @@ export declare const useHotelDetails: (hotel: IHotelDetails) => {
|
|
|
9
9
|
bestCheckout: import('./useHotelDetails.types').IBestCheckout | undefined;
|
|
10
10
|
loadingBestCheckout: boolean;
|
|
11
11
|
isAvailable: boolean;
|
|
12
|
-
pointsAsCash: import('../../
|
|
12
|
+
pointsAsCash: import('../../main').IPointsAsCash | undefined;
|
|
13
13
|
hotelDetails: IHotelDetails;
|
|
14
14
|
};
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IRoom, IRate } from './services/booking/BookingService.types';
|
|
2
2
|
import { IHotelDetails } from './components/HotelResult/HotelResult.types';
|
|
3
|
+
import { IPointsAsCash } from './utilities/pointsAsCashUtils';
|
|
3
4
|
export { ESearchType } from './services/hotel/HotelService.types';
|
|
4
5
|
export * from './components';
|
|
5
6
|
export * from './hooks';
|
|
6
|
-
export type { IRoom, IRate, IHotelDetails };
|
|
7
|
+
export type { IRoom, IRate, IHotelDetails, IPointsAsCash };
|
|
@@ -118,8 +118,8 @@ export interface IPlaceResponse {
|
|
|
118
118
|
country: INameCode;
|
|
119
119
|
state: INameCode;
|
|
120
120
|
description: string;
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
search_type: string;
|
|
122
|
+
search_id: string;
|
|
123
123
|
}
|
|
124
124
|
export interface IHotelResponse {
|
|
125
125
|
city: string;
|
|
@@ -130,8 +130,9 @@ export interface IHotelResponse {
|
|
|
130
130
|
hotel_id: string;
|
|
131
131
|
hotel_name: string;
|
|
132
132
|
description: string;
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
search_type: string;
|
|
134
|
+
search_id: string;
|
|
135
|
+
type: string;
|
|
135
136
|
}
|
|
136
137
|
export interface ISearchLocation {
|
|
137
138
|
searchId: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IUserCard } from '../services/wallet/WalletService.types';
|
|
1
2
|
export interface IPointsAsCash {
|
|
2
3
|
totalPointsUsed: number;
|
|
3
4
|
pointsAsCash: number;
|
|
4
|
-
card
|
|
5
|
+
card?: IUserCard;
|
|
5
6
|
cashRequired: number;
|
|
6
7
|
}
|
|
7
8
|
export declare const calculatePointsAsCash: (cashRequired: number) => Promise<IPointsAsCash | undefined>;
|
|
@@ -28,17 +28,17 @@ class H {
|
|
|
28
28
|
success: !1,
|
|
29
29
|
message: (e == null ? void 0 : e.message) || "Error fetching location data"
|
|
30
30
|
};
|
|
31
|
-
const t = (o) => o.
|
|
31
|
+
const t = (o) => o.type === C.HOTEL;
|
|
32
32
|
return {
|
|
33
33
|
success: !0,
|
|
34
34
|
data: e.data.cities.map(
|
|
35
35
|
(o) => {
|
|
36
|
-
const {
|
|
36
|
+
const { search_id: p, type: _, description: d, coordinates: y, city: g } = o, n = {
|
|
37
37
|
searchId: p,
|
|
38
38
|
searchType: _,
|
|
39
39
|
description: d,
|
|
40
|
-
coordinates:
|
|
41
|
-
city:
|
|
40
|
+
coordinates: y,
|
|
41
|
+
city: g
|
|
42
42
|
};
|
|
43
43
|
return t(o) ? (n.country = {
|
|
44
44
|
code: o.country_code,
|
|
@@ -4,7 +4,7 @@ import { WalletService as l } from "../services/wallet/WalletService.js";
|
|
|
4
4
|
const A = async (n) => {
|
|
5
5
|
const e = await f();
|
|
6
6
|
if (!e)
|
|
7
|
-
return { pointsAsCash: 0, totalPointsUsed: 0,
|
|
7
|
+
return { pointsAsCash: 0, totalPointsUsed: 0, cashRequired: n };
|
|
8
8
|
const { banks: s } = await u.ensureQueryData({
|
|
9
9
|
queryKey: ["walletAwards"],
|
|
10
10
|
queryFn: l.getAwards
|