-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Bug Report
Payload allows for updating doc with only partial data, but the inferred type requires the whole collection object:
Steps to Reproduce
- Create a document
- Update document using Local API with partial data
- Typescript errors, but the update posted correctly by Payload.
Other Details
Payload v1.16.3
This can be fixed by changing from MarkOptional<GeneratedTypes['collections'][TSlug], 'id' | 'updatedAt' | 'createdAt'>
to Partial<GeneratedTypes['collections'][TSlug]>
:
https://github.com/payloadcms/payload/blob/master/src/collections/operations/local/update.ts#LL16
Posted a PR #2010
Metadata
Metadata
Assignees
Labels
status: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet