Search.../

removeFromTrashBin( )

Developer Preview

Permanently deletes a draft post by the provided ID from the trash bin.

Description

Uses the provided draftPostId to permanently delete a draft post from the trash bin. This action is permanent and cannot be reversed.

Admin Method

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

Syntax

function removeFromTrashBin(draftPostId: string): Promise<void>

removeFromTrashBin Parameters

NAME
TYPE
DESCRIPTION
draftPostId
string

Draft post ID.

Returns

Return Type:

Promise<
void
>

Was this helpful?

removeFromTrashBin example

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