Merged in fix/SW-2508-new-api-cancel-booking-contract (pull request #1906)

Ending up doing some extra things:

Consolidated booking queries: We had both cancel and cancelMany, but functionally they’re the same, only one accepts an array and the other doesn’t. Didn’t see much point in keeping the single cancel as it wasn’t used anywhere. Thus, I could rename cancelMany to be the one stop method.

remove method for API now properly supports body so we don’t have to hijack the typing in certain places

* fix(SW-2508): now sending additional params to cancel api for new contract


Approved-by: Niclas Edenvin
This commit is contained in:
Christian Andolf
2025-05-02 07:37:23 +00:00
committed by Niclas Edenvin
parent f0dbf294d8
commit 43bdd80dff
5 changed files with 24 additions and 32 deletions

View File

@@ -40,7 +40,7 @@ export default function FinalConfirmation({
defaultMessage: "Were sorry that things didnt work out.",
})
const cancelBookingsMutation = trpc.booking.cancelMany.useMutation({
const cancelBookingsMutation = trpc.booking.cancel.useMutation({
onSuccess(data, variables) {
const allCancellationsWentThrough = data.every((cancelled) => cancelled)
if (allCancellationsWentThrough) {