Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions packages/payload/src/collections/operations/findVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,42 @@ export const findVersionsOperation = async <TData extends TypeWithVersion<TData>
const { fallbackLocale, locale, payload } = req

try {
// /////////////////////////////////////
// beforeOperation - Collection
// /////////////////////////////////////

if (args.collection.config.hooks?.beforeOperation?.length) {
for (const hook of args.collection.config.hooks.beforeOperation) {
args =
(await hook({
args,
collection: args.collection.config,
context: args.req!.context,
operation: 'read',
req: args.req!,
})) || args
}
}

const {
collection: { config: collectionConfig },
collection,
depth,
limit,
overrideAccess,
page,
pagination = true,
populate,
select: incomingSelect,
showHiddenFields,
sort: incomingSort,
trash = false,
where,
} = args

const req = args.req!
const { fallbackLocale, locale, payload } = req
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant with the above.


// /////////////////////////////////////
// Access
// /////////////////////////////////////
Expand Down
Loading