Skip to main content
Requires the entities bundle. A project without the entities bundle returns 403 database/tables-not-available. See Bundles.

Overview

useFetchDrafts returns a function that retrieves the authenticated user’s unpublished draft entities in a paginated response. A draft marked removed (moderationStatus: "removed") is listed too, but it can’t be published or edited, only deleted.
Requires an authenticated user. Only the user’s own drafts are returned.

Usage Example

Parameters

number
Page number (1-indexed). Defaults to 1.
number
Results per page: a whole number from 1 to 100. Defaults to 10. A larger value is rejected with 400 entity/invalid-query, never lowered to 100.
string | "none"
Only drafts from this source, or "none" for drafts with no source. Left out: any source.
string | "none"
Only drafts in this space, or "none" for drafts in no space. Left out: any space, or none.
DraftIncludeParam
Populate related fields. Accepted values: "user", "space", "files", "grants" (typed as DraftIncludeParam). Any other value is rejected by the server with 400 entity/invalid-query.

Returns

Entity[]
Array of draft entities for the current page.
number
Current page number.
number
Number of results per page.
number
Total number of pages.
number
Total count of the user’s drafts.
boolean
true if there are additional pages available.