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
23.54k stars 1.5k forks source link

chore!: simplify api handler #6910

Closed JarrodMFlesch closed 2 months ago

JarrodMFlesch commented 3 months ago

Removes PayloadRequestWithData in favour of just PayloadRequest with optional types for data and locale

addDataAndFileToRequest and addLocalesToRequestFromData now takes in a single argument instead of an object

// before
await addDataAndFileToRequest({ request: req })
addLocalesToRequestFromData({ request: req })

// current
await addDataAndFileToRequest(req)
addLocalesToRequestFromData(req)