mozrest-sdk-react-dev 0.3.22 → 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 +14 -2
- package/package.json +1 -1
package/mozrest-sdk.es.js
CHANGED
|
@@ -127768,11 +127768,23 @@ const UpdateBooking = async ({ venueId, bookingId, data: data2 }) => {
|
|
|
127768
127768
|
);
|
|
127769
127769
|
return { data: "updated" };
|
|
127770
127770
|
};
|
|
127771
|
-
const
|
|
127771
|
+
const CancelBooking = async ({ venueId, bookingId }) => {
|
|
127772
|
+
const data2 = {
|
|
127773
|
+
cancelActor: "Restaurant",
|
|
127774
|
+
cancelReason: "Canceled by restaurant"
|
|
127775
|
+
};
|
|
127772
127776
|
await instance$1.put(
|
|
127773
|
-
`/
|
|
127777
|
+
`/v1/bc/booking/${bookingId}/cancel`,
|
|
127774
127778
|
data2
|
|
127775
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
|
+
}
|
|
127776
127788
|
return { data: "ok" };
|
|
127777
127789
|
};
|
|
127778
127790
|
const ReloadContext = createContext(void 0);
|