Skip to content

Commit

Permalink
fix: add optional 'errors' property to entry reference return type (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
damienxy authored Dec 15, 2022
1 parent 4ab6719 commit 89f5bcf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/entities/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,24 @@ export type EntryProps<T = KeyValueMap> = {

export type CreateEntryProps<TFields = KeyValueMap> = Omit<EntryProps<TFields>, 'sys'>

export type EntryReferenceError = {
sys: {
type: 'error'
id: 'notResolvable'
}
details: {
type: 'Link'
linkType: 'Entry' | 'Asset'
id: string
}
}

export interface EntryReferenceProps extends CollectionProp<EntryProps> {
includes?: {
Entry?: EntryProps[]
Asset?: AssetProps[]
}
errors?: EntryReferenceError[]
}

export type EntryReferenceOptionsProps = {
Expand Down

0 comments on commit 89f5bcf

Please sign in to comment.