payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
27.66k stars 1.72k forks source link

fix: invalid `payload.collections` type #9414

Closed r1tsuu closed 16 hours ago

r1tsuu commented 16 hours ago

What?

payload.collections was improperly typed. This doesn't seem to work: (the type is {})

collections: {
  [slug: CollectionSlug]: Collection
} = {}
image

However, this does:

collections: Record<CollectionSlug, Collection> = {}
image

Additionally, the same fix applied to Permissions, PolymorphicUploadField['admin']['sortOptions'], PolymorphicRelationshipField['admin']['sortOptions']