arky-sdk 0.3.78 → 0.3.80
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/index.cjs +3 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +3 -23
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +0 -6
- package/dist/types.d.ts +0 -6
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1027,13 +1027,11 @@ var createReservationApi = (apiConfig) => {
|
|
|
1027
1027
|
...params,
|
|
1028
1028
|
items
|
|
1029
1029
|
};
|
|
1030
|
-
|
|
1030
|
+
return apiConfig.httpClient.post(
|
|
1031
1031
|
`/v1/reservations/checkout`,
|
|
1032
1032
|
payload,
|
|
1033
1033
|
options
|
|
1034
1034
|
);
|
|
1035
|
-
cart = [];
|
|
1036
|
-
return result;
|
|
1037
1035
|
},
|
|
1038
1036
|
async getReservation(params, options) {
|
|
1039
1037
|
return apiConfig.httpClient.get(`/v1/reservations/${params.id}`, {
|
|
@@ -1774,7 +1772,6 @@ var createInitialState = (timezone) => ({
|
|
|
1774
1772
|
service: null,
|
|
1775
1773
|
providers: [],
|
|
1776
1774
|
selectedProvider: null,
|
|
1777
|
-
selectedMethod: null,
|
|
1778
1775
|
currentMonth: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1),
|
|
1779
1776
|
calendar: [],
|
|
1780
1777
|
selectedDate: null,
|
|
@@ -1865,7 +1862,6 @@ var createReservationEngine = (api, config = {}) => {
|
|
|
1865
1862
|
store.set({
|
|
1866
1863
|
...store.get(),
|
|
1867
1864
|
service,
|
|
1868
|
-
selectedMethod: service.reservationMethods?.length === 1 ? service.reservationMethods[0] : null,
|
|
1869
1865
|
selectedProvider: null,
|
|
1870
1866
|
providers: [],
|
|
1871
1867
|
selectedDate: null,
|
|
@@ -1909,19 +1905,6 @@ var createReservationEngine = (api, config = {}) => {
|
|
|
1909
1905
|
store.setKey("currentMonth", new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1));
|
|
1910
1906
|
actions.loadMonth();
|
|
1911
1907
|
},
|
|
1912
|
-
selectMethod(method) {
|
|
1913
|
-
store.set({
|
|
1914
|
-
...store.get(),
|
|
1915
|
-
selectedMethod: method,
|
|
1916
|
-
selectedProvider: null,
|
|
1917
|
-
selectedDate: null,
|
|
1918
|
-
startDate: null,
|
|
1919
|
-
endDate: null,
|
|
1920
|
-
slots: [],
|
|
1921
|
-
selectedSlot: null
|
|
1922
|
-
});
|
|
1923
|
-
store.setKey("calendar", buildCalendar());
|
|
1924
|
-
},
|
|
1925
1908
|
selectProvider(provider) {
|
|
1926
1909
|
store.set({
|
|
1927
1910
|
...store.get(),
|
|
@@ -1982,21 +1965,18 @@ var createReservationEngine = (api, config = {}) => {
|
|
|
1982
1965
|
if (!state.cart.length) throw new Error("Cart is empty");
|
|
1983
1966
|
store.setKey("loading", true);
|
|
1984
1967
|
try {
|
|
1985
|
-
|
|
1968
|
+
return api.checkout({
|
|
1986
1969
|
items: state.cart.map((s) => ({
|
|
1987
1970
|
serviceId: s.serviceId,
|
|
1988
1971
|
providerId: s.providerId,
|
|
1989
1972
|
from: s.from,
|
|
1990
1973
|
to: s.to,
|
|
1991
|
-
blocks: s.serviceBlocks || []
|
|
1992
|
-
reservationMethod: s.reservationMethod || state.selectedMethod || "STANDARD"
|
|
1974
|
+
blocks: s.serviceBlocks || []
|
|
1993
1975
|
})),
|
|
1994
1976
|
paymentMethod: options.paymentMethod,
|
|
1995
1977
|
promoCode: options.promoCode ?? null,
|
|
1996
1978
|
blocks: options.blocks || []
|
|
1997
1979
|
});
|
|
1998
|
-
store.setKey("cart", []);
|
|
1999
|
-
return result;
|
|
2000
1980
|
} finally {
|
|
2001
1981
|
store.setKey("loading", false);
|
|
2002
1982
|
}
|