Skip to content

Commit 9b6e1a3

Browse files
authored
fix: type TypeWithVersion missing latest property (#14676)
### What? Adds the missing `latest?: boolean` property to the `TypeWithVersion<T>` type definition. ### Why? The `latest` property is set by database adapters when creating and updating versions (both collection and global versions), and is included in the version field schema when drafts are enabled. However, it was missing from the TypeScript type definition, causing type errors when consumers try to access this property on version documents. ### How? Added `latest?: boolean` as an optional property to the `TypeWithVersion<T>` type. The property is optional because it's only present when drafts are enabled in the version configuration. Fixes #14624
1 parent 220a18f commit 9b6e1a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/payload/src/versions/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export type SanitizedGlobalVersions = {
122122
export type TypeWithVersion<T> = {
123123
createdAt: string
124124
id: string
125+
latest?: boolean
125126
parent: number | string
126127
publishedLocale?: string
127128
snapshot?: boolean

0 commit comments

Comments
 (0)