Search.../

getDeletedDraftPost( )

Developer Preview

Gets a deleted draft post from the trash bin by the provided ID.

Description

Uses the provided draftPostId to retrieve a previously deleted draft post from the trash bin.

Admin Method

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

Syntax

function getDeletedDraftPost(draftPostId: string): Promise<GetDeletedDraftPostResponse>

getDeletedDraftPost Parameters

NAME
TYPE
DESCRIPTION
draftPostId
string

Draft post ID.

Returns

Return Type:

Promise<
GetDeletedDraftPostResponse
>
NAME
TYPE
DESCRIPTION
draftPost
DraftPost

Draft post info.

Was this helpful?

getDeletedDraftPost example

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