@odynn/awayz-core 0.9.23 → 0.9.24

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.
@@ -30,21 +30,21 @@ class O {
30
30
  );
31
31
  if (!(a != null && a.success))
32
32
  return [];
33
- const s = a.data.map((c) => ({
33
+ const t = a.data.map((c) => ({
34
34
  ...c,
35
35
  flightBookings: T(c.flight_bookings ?? []),
36
36
  hotelBookings: b(c.hotel_bookings ?? [])
37
37
  }));
38
- return d(s);
38
+ return d(t);
39
39
  });
40
40
  n(this, "updateTrip", async (e, a) => {
41
- const { data: s } = await i.put(
41
+ const { data: t } = await i.put(
42
42
  `${o.TRIPS}/${e}`,
43
43
  D(u(a))
44
44
  );
45
- return s != null && s.success ? {
45
+ return t != null && t.success ? {
46
46
  success: !0,
47
- data: d(s.data),
47
+ data: d(t.data),
48
48
  message: "Trip updated successfully."
49
49
  } : {
50
50
  success: !1,
@@ -69,30 +69,30 @@ class O {
69
69
  hotelBookings: []
70
70
  };
71
71
  });
72
- n(this, "addBookingToTrip", async (e, a, s) => {
73
- const { data: t } = await i.put(o.ADD_BOOKING, {
72
+ n(this, "addBookingToTrip", async (e, a, t) => {
73
+ const { data: s } = await i.put(o.ADD_BOOKING, {
74
74
  trip_id: e,
75
75
  booking_id: a,
76
- booking_type: s
76
+ booking_type: t
77
77
  });
78
- return t.success;
78
+ return s.success;
79
79
  });
80
- n(this, "removeBookingFromTrip", async (e, a, s) => {
81
- const { data: t } = await i.put(
80
+ n(this, "removeBookingFromTrip", async (e, a, t) => {
81
+ const { data: s } = await i.put(
82
82
  o.REMOVE_BOOKING,
83
83
  u({
84
84
  trip_id: e,
85
85
  booking_id: a,
86
- booking_type: s
86
+ booking_type: t
87
87
  })
88
88
  );
89
- return t.success;
89
+ return s.success;
90
90
  });
91
91
  }
92
92
  }
93
93
  const T = (r) => r.map((e) => {
94
94
  var c, l, _, g;
95
- const a = e.slices.length > 1, s = e.slices[0], t = a ? e.slices.getLast() : void 0;
95
+ const a = e.slices.length > 1, t = e.slices[0], s = a ? e.slices.getLast() : void 0;
96
96
  return d({
97
97
  id: e._id,
98
98
  reference: e.booking_reference,
@@ -107,24 +107,24 @@ const T = (r) => r.map((e) => {
107
107
  };
108
108
  }),
109
109
  arrival: {
110
- airportCode: s.destination,
110
+ airportCode: t.destination,
111
111
  location: ""
112
112
  },
113
113
  departure: {
114
- airportCode: s.origin,
114
+ airportCode: t.origin,
115
115
  location: ""
116
116
  },
117
- class: s.fare_brand_name,
117
+ class: t.fare_brand_name,
118
118
  passengers: e.passengers.length,
119
119
  hasAirlineChanges: !1,
120
120
  orderId: e.order_id,
121
121
  type: e.type,
122
122
  cancelledAt: e.cancelled_at,
123
123
  isRoundTrip: a,
124
- outboundArrivalDate: (l = (c = s.segments) == null ? void 0 : c.getLast()) == null ? void 0 : l.arriving_at,
125
- inboundDepartureDate: t ? (g = (_ = t.segments) == null ? void 0 : _[0]) == null ? void 0 : g.departing_at : void 0,
126
- inboundDeparture: t ? { airportCode: t.origin, location: "" } : void 0,
127
- inboundArrival: t ? { airportCode: t.destination, location: "" } : void 0
124
+ outboundArrivalDate: t.arriving_at ?? ((l = (c = t.segments) == null ? void 0 : c.getLast()) == null ? void 0 : l.arriving_at),
125
+ inboundDepartureDate: s ? s.departing_at ?? ((g = (_ = s.segments) == null ? void 0 : _[0]) == null ? void 0 : g.departing_at) : void 0,
126
+ inboundDeparture: s ? { airportCode: s.origin, location: "" } : void 0,
127
+ inboundArrival: s ? { airportCode: s.destination, location: "" } : void 0
128
128
  });
129
129
  }), b = (r) => r.map(
130
130
  (e) => d({
@@ -13,7 +13,7 @@ import { awayzClient as o } from "../../configs/awayzClient.js";
13
13
  import "../../index-Cv-wvFlM.js";
14
14
  import "../../context/AwayzContext.js";
15
15
  /* empty css */
16
- import { T as n } from "../../TripsService-GImsS17_.js";
16
+ import { T as n } from "../../TripsService-CJxjOcrR.js";
17
17
  const b = ({
18
18
  tripId: t,
19
19
  tripDetails: s
@@ -1,5 +1,5 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-GImsS17_.js";
2
+ import { D as f } from "../../TripsService-CJxjOcrR.js";
3
3
  import "react";
4
4
  import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
5
5
  import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
2
  import "../../noRetryInstance-DKhe8ju0.js";
3
- import { T } from "../../TripsService-GImsS17_.js";
3
+ import { T } from "../../TripsService-CJxjOcrR.js";
4
4
  import "react";
5
5
  import "../../configs/defaultAwayzConfig.js";
6
6
  import "../../configs/endpoints.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.9.23",
3
+ "version": "0.9.24",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"