@odynn/awayz-hotels 0.1.14 → 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.
|
@@ -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
|
};
|
|
@@ -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;
|
|
@@ -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,
|