Skip to content

Not all local operations accept a PayloadRequest parameter #3650

Closed

Description

@diesieben07

Link to reproduction

export type Options<T extends keyof GeneratedTypes['collections']> = {
collection: T
/**
* context, which will then be passed to req.context, which can be read by hooks
*/
context?: RequestContext
depth?: number
draft?: boolean
fallbackLocale?: string
limit?: number
locale?: string
overrideAccess?: boolean
page?: number
showHiddenFields?: boolean
sort?: string
user?: Document
where?: Where
}

To Reproduce

Attempt to use one of the local operations findGlobalVersionByID, findGlobalVersions, restoreGlobalVersion, findVersions or restoreVersion with manual transaction management (i.e. passing a PayloadRequest with a transactionID).
Observe that they do not accept a req parameter (in contrast to all other local operations).

Describe the Bug

I assume this is just an oversight as it seems to be pretty random which operations are affected and there does not seem to be a reason for them to be excluded from this feature.
For example, findVersionByID accepts a PayloadRequest, but findGlobalVersionByID does not.

Payload Version

2.0.5

Adapters and Plugins

n/a

Activity

  1. added
    status: needs-triage
    on Oct 13, 2023
  2. diesieben07 commented on Oct 13, 2023

    @diesieben07
    ContributorAuthor

    I am working on a pull request to fix this issue.

  3. github-actions commented on Sep 7, 2024

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  4. locked as resolved and limited conversation to collaborators on Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: needs-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions