fix: Hosts are able to cancel an event without providing any reason but with whitepsace characters (#22282)

Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
This commit is contained in:
Anwar SadathandAnik Dhabal Babu authored and GitHub committed 2025-07-09 00:17:13 +01:00
1 parent 02321c33b2
commit 27cd7c8496
2 files changed
+2 -2

No files matched your search

@@ -199,7 +199,7 @@ export default function CancelBooking(props: Props) {
data-testid="confirm_cancel"
disabled={
props.isHost &&
(!cancellationReason || (props.internalNotePresets.length > 0 && !internalNote?.id))
(!cancellationReason?.trim() || (props.internalNotePresets.length > 0 && !internalNote?.id))
}
onClick={async () => {
setLoading(true);
@@ -113,7 +113,7 @@ async function handler(input: CancelBookingInput) {
});
}
if (!platformClientId && !cancellationReason && bookingToDelete.userId == userId) {
if (!platformClientId && !cancellationReason?.trim() && bookingToDelete.userId == userId) {
throw new HttpError({
statusCode: 400,
message: "Cancellation reason is required when you are the host",