Skip to content

fix: deletedAt in TypeWithID not accepting null from generated types - #13363

Merged
denolfe merged 2 commits into
mainfrom
fix/typewithid-deletedat-null
Aug 5, 2025
Merged

denolfe merged 2 commits into
mainfrom
fix/typewithid-deletedat-null

Conversation

@PatrikKozak

@PatrikKozak PatrikKozak commented Aug 4, 2025 •

Copy link
Copy Markdown
Contributor

What?

Updated TypeWithID so deletedAt can accept null.

Why?

Generated collection types for trash use:

deletedAt?: string | null

TypeWithID previously only allowed string | undefined, so assigning documents with deletedAt: null caused TypeScript errors.

Aligning the types fixes this mismatch and ensures TypeWithID is compatible with the generated types.

How?

Modified the TypeWithID definition to:

export type TypeWithID = {
  deletedAt?: string | null
  docId?: any
  id: number | string
}

This makes deletedAt effectively string | null | undefined, matching generated types and eliminating type errors.

Fixes #13341


@github-actions

github-actions Bot commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@denolfe
denolfe merged commit 8401b21 into main Aug 5, 2025
@denolfe
denolfe deleted the fix/typewithid-deletedat-null branch August 5, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mismatch of deleteAt typings

2 participants