Search.../

publishDraft( )

Publishes the draft form.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function publishDraft(eventId: string): Promise<PublishDraftResponse>

publishDraft Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID to which the form belongs.

Returns

Return Type:

Promise<
PublishDraftResponse
>
NAME
TYPE
DESCRIPTION
form
Form

Published event form.

Was this helpful?

publishDraft example

Copy Code
1import { forms } from 'wix-events.v2';
2
3 async function publishDraft(eventId) {
4 try {
5 const result = await forms.publishDraft(eventId);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13