@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.
@@ -1,17 +1,17 @@
1
- import { useQuery as r } from "@tanstack/react-query";
2
- import { HotelService as t } from "../../services/hotel/HotelService.js";
3
- const c = (o) => {
4
- const { data: e, isLoading: i } = r({
5
- queryKey: ["locations", o],
6
- queryFn: () => t.getLocations(o),
7
- enabled: !!o
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: (e == null ? void 0 : e.data) || [],
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
- c as useLocationSearch
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: IPointsAsCash;
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 IPointsAsCash {
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('../../utilities/pointsAsCashUtils').IPointsAsCash | undefined;
12
+ pointsAsCash: import('../../main').IPointsAsCash | undefined;
13
13
  hotelDetails: IHotelDetails;
14
14
  };
@@ -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
- searchType: string;
122
- searchId: string;
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
- searchType: string;
134
- searchId: string;
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: any;
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.searchType === C.HOTEL;
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 { searchId: p, searchType: _, description: d, coordinates: g, city: y } = o, n = {
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: g,
41
- city: y
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, card: null, cashRequired: n };
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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@odynn/awayz-hotels",
3
3
  "private": false,
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"