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:
@@ -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);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user