unassignEvents( )


Unassigns events from a category.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Events - all permissions
Learn more about app permissions.
Method Declaration
Copy
function unassignEvents(
  categoryId: string,
  eventId: Array<string>,
): Promise<void>;
Method Parameters
categoryIdstringRequired

Category ID.


eventIdArray<string>Required

A list of events IDs.

JavaScript
import { categories } from "wix-events.v2"; import { webMethod, Permissions } from "wix-web-module"; import { elevate } from "wix-auth"; const elevatedUnassignEvents = elevate(categories.unassignEvents); /* * Sample categoryId value: "6ec293a8-1b47-4337-9c4e-9a6aeb35e66a" * Sample eventId value: ["4e5e4adb-9778-4171-a9bb-44e27834ac89"] */ export const myUnassignEventsFunction = webMethod( Permissions.Anyone, async (categoryId, eventId) => { try { const unassignedEvents = await elevatedUnassignEvents( categoryId, eventId, ); console.log("Events are unassigned from the category"); return unassignedEvents; } catch (error) { console.error(error); // Handle the error } }, ); /* Promise resolves to void */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?