Skip to content
On this page

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/sdk / rest / promoteContentVersion

Function: promoteContentVersion()

promoteContentVersion<Schema, Collection, Item>(id, mainHash, fields?): RestCommand<string | number, Schema>

Promote an existing Content Version to become the new main version of the item.

Type parameters

Schema extends object

Collection extends string | number | symbol

Item = UnpackList<Schema[Collection]>

Parameters

id: DirectusVersion<Schema>["id"]

Primary key of the version.

mainHash: string

The current hash of the main version of the item (obtained from the compare endpoint).

fields?: keyof UnpackList<Item>[]

Optional array of field names of which the values are to be promoted. By default, all fields are selected.

Returns

RestCommand<string | number, Schema>

The primary key of the promoted item.

Source

rest/commands/utils/versions.ts:69