v3.0.0-beta.15
Pre-release
Pre-release
What's Changed
Features
- feat!: removed getDataAndFile and getLocales from createPayloadRequest in favour of new utilities addDataAndFileToRequest and addLocalesToRequest by @paulpopus in #5999
- feat(richtext-lexical)!: rework population behavior and allow richText adapter field hooks by @AlessioGr in #5893
Fixes
- fix: issues creating the first user by @paulpopus in #5986
- fix: type collection config missing dbName by @DanRibbens in #5983
- fix(db-postgres): postgres uuid by @denolfe in #6003
⚠ BREAKING CHANGES
- feat!: removed getDataAndFile and getLocales from createPayloadRequest in favour of new utilities addDataAndFileToRequest and addLocalesToRequest by @paulpopus in #5999
Custom handlers will no longer resolve data
, locale
and fallbackLocale
for you. Instead you can use our provided utilities from the next
package
// ❌ 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: v3.0.0-beta.14...v3.0.0-beta.15