Search.../

listDraftPosts( )

Developer Preview

Retrieves a list of up to 100 draft posts per request.

Description

List Draft Posts runs with these defaults, which you can override:

  • editedDate is sorted in descending order.
  • paging.limit is 50.
  • paging.offset is 0.
Admin Method

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

Syntax

function listDraftPosts(options: ListDraftPostsOptions): Promise<ListDraftPostsResponse>

listDraftPosts Parameters

NAME
TYPE
DESCRIPTION
options
Optional
ListDraftPostsOptions

Options for listing multiple draft posts.

Returns

Return Type:

Promise<
ListDraftPostsResponse
>
NAME
TYPE
DESCRIPTION
draftPosts
Array<
DraftPost
>

List of draft posts.

metaData
MetaData

Details on the paged set of results returned.

Was this helpful?

listDraftPosts example

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