method

LocalAPI.DiscardDraft

DiscardDraft atomically resets a pending working version to the live head. It requires Update access and an expected working revision when provided.

Arguments

ArgumentTypeDescription
ctxcontext.ContextThe ctx value.
collectionstringThe collection value.
idstringThe id value.
optionsMutationOptionsThe options value.

Returns

The declared result.

(store.Document, error)

Full signature

func (local *LocalAPI) DiscardDraft( ctx context.Context, collection, id string, options MutationOptions, ) (store.Document, error)

Source core/local.go:552

Related types

  • LocalAPI

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

  • MutationOptions

    Authorization, optimistic concurrency, response population, create status, and locale controls for one write.

  • Document

    A stored document with status and version metadata.