method

LocalAPI.RestoreDeleted

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

Move an authorized trashed document back into ordinary collection reads.

Source core/local.go:648

@param ctx
Request context.
@param collection
Trash-enabled collection slug.
@param id
Trashed document ID.
@param actor
Authenticated actor, or nil.
@param localeOptions
Optional locale selection.
@returns
The restored document, or an operation error.

Example

go
restored, err := app.Local().RestoreDeleted(ctx, "posts", postID, actor)

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.