mozrest-sdk-react-dev 0.3.21 → 0.3.23
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/mozrest-sdk.es.js +17 -3
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -126915,7 +126915,9 @@ const StatsBar = ({
|
|
|
126915
126915
|
...payload
|
|
126916
126916
|
};
|
|
126917
126917
|
if (cancellations) {
|
|
126918
|
-
params2["filters[
|
|
126918
|
+
params2["filters[statuses]"] = ["canceled", "cancelled"];
|
|
126919
|
+
} else {
|
|
126920
|
+
params2["filters[excludeStatus]"] = ["require_payment"];
|
|
126919
126921
|
}
|
|
126920
126922
|
const [, response] = await handlePromise(ReservationAnalyticsService.getBookingItemTotal(params2));
|
|
126921
126923
|
if (!response) return;
|
|
@@ -127766,11 +127768,23 @@ const UpdateBooking = async ({ venueId, bookingId, data: data2 }) => {
|
|
|
127766
127768
|
);
|
|
127767
127769
|
return { data: "updated" };
|
|
127768
127770
|
};
|
|
127769
|
-
const
|
|
127771
|
+
const CancelBooking = async ({ venueId, bookingId }) => {
|
|
127772
|
+
const data2 = {
|
|
127773
|
+
cancelActor: "Restaurant",
|
|
127774
|
+
cancelReason: "Canceled by restaurant"
|
|
127775
|
+
};
|
|
127770
127776
|
await instance$1.put(
|
|
127771
|
-
`/
|
|
127777
|
+
`/v1/bc/booking/${bookingId}/cancel`,
|
|
127772
127778
|
data2
|
|
127773
127779
|
);
|
|
127780
|
+
return { data: "canceled" };
|
|
127781
|
+
};
|
|
127782
|
+
const UpdateBookingStatusBooking = async ({ venueId, bookingId, data: data2 }) => {
|
|
127783
|
+
if ((data2 == null ? void 0 : data2.status) === "canceled") {
|
|
127784
|
+
await CancelBooking({ venueId, bookingId });
|
|
127785
|
+
} else {
|
|
127786
|
+
await UpdateBooking({ venueId, bookingId, data: data2 });
|
|
127787
|
+
}
|
|
127774
127788
|
return { data: "ok" };
|
|
127775
127789
|
};
|
|
127776
127790
|
const ReloadContext = createContext(void 0);
|