v3.0.0-beta.15
Version v3.0.0-beta.15Major ReleasePre-release
Release Notes
What's Changed
Features
- feat!: removed getDataAndFile and getLocales from createPayloadRequest in favour of new utilities addDataAndFileToRequest and addLocalesToRequest by @paulpopus in https://github.com/payloadcms/payload/pull/5999
- feat(richtext-lexical)!: rework population behavior and allow richText adapter field hooks by @AlessioGr in https://github.com/payloadcms/payload/pull/5893
Fixes
- fix: issues creating the first user by @paulpopus in https://github.com/payloadcms/payload/pull/5986
- fix: type collection config missing dbName by @DanRibbens in https://github.com/payloadcms/payload/pull/5983
- fix(db-postgres): postgres uuid by @denolfe in https://github.com/payloadcms/payload/pull/6003
⚠ BREAKING CHANGES
- feat!: removed getDataAndFile and getLocales from createPayloadRequest in favour of new utilities addDataAndFileToRequest and addLocalesToRequest by @paulpopus in https://github.com/payloadcms/payload/pull/5999
Custom handlers will no longer resolve
data,localeandfallbackLocalefor you. Instead you can use our provided utilities from thenextpackage
```ts
// ❌ Before
{
path: '/whoami/:parameter',
method: 'post',
handler: async (req) => {
return Response.json({
name: req.data.name, // data will be undefined
// locales will be undefined
fallbackLocale: req.fallbackLocale,
locale: req.locale,
})
}
}
// ✅ After
import { addDataAndFileToRequest } from '@payloadcms/next/utilities'
import { addLocalesToRequest } from '@payloadcms/next/utilities'
{
path: '/whoami/:parameter',
method: 'post',
handler: async (req) => {
// mutates req, must be awaited
await addDataAndFileToRequest(req)
// mutates req
addLocalesToRequest(req)
return Response.json({
name: req.data.name, // data is now available
fallbackLocale: req.fallbackLocale, // locales available
locale: req.locale,
})
}
}
```
Full Changelog: https://github.com/payloadcms/payload/compare/v3.0.0-beta.14...v3.0.0-beta.15