method

LocalAPI.RestoreAsDraft

func (local *LocalAPI) RestoreAsDraft( ctx context.Context, collection, id string, revision, expectedRevision int, actor *store.Document, localeOptions ...LocaleOptions, ) (store.Document, error)

Restore a retained revision while explicitly keeping the current document unpublished.

Source core/local.go:622

@param ctx
Request context.
@param collection
Versioned collection slug.
@param id
Document ID.
@param revision
Retained revision to restore.
@param expectedRevision
Expected current revision for optimistic concurrency.
@param actor
Authenticated actor, or nil.
@param localeOptions
Optional locale selection.
@returns
The restored draft document, or an operation error.

Related types

  • LocalAPI

    In-process content operations that share the REST authorization and lifecycle pipeline.

  • Document

    A stored document with status and version metadata.

  • LocaleOptions

    Locale selection for one single-document Local API operation.