Skip to main content

Overview

useCancelEvent returns a callable that cancels an event by setting its status to "cancelled". Host-only. The event stays fetchable but rejects new RSVPs. When the notifications bundle is enabled, all going/maybe attendees receive an event-cancelled notification.

Usage Example

import { useCancelEvent } from "@sublay/react-js";

function CancelButton({ eventId }: { eventId: string }) {
  const cancelEvent = useCancelEvent();
  return <button onClick={() => cancelEvent({ eventId })}>Cancel event</button>;
}

Parameters

eventId
string
required
The event to cancel.

Returns

Returns a Promise<Event> — the Event with status: "cancelled".

See Also