fix: recurring booking idempotency key after cancel (#16414)

* fix: recurring booking idempotency key after cancel

* refactor: move logic to updateMany of prisma middleware
This commit is contained in:
Lauris Skraucis
2024-08-30 12:07:53 +00:00
committed by GitHub
parent 40fee7af51
commit d19e3e53f0
@@ -32,6 +32,12 @@ export function bookingIdempotencyKeyExtension() {
}
return query(args);
},
async updateMany({ args, query }) {
if (args.data.status === BookingStatus.CANCELLED || args.data.status === BookingStatus.REJECTED) {
args.data.idempotencyKey = null;
}
return query(args);
},
},
},
});