feat!: removed getDataAndFile and getLocales from createPayloadRequest in favour of new utilities addDataAndFileToRequest and addLocalesToRequest (#5999)

This commit is contained in:
Paul
2024-04-24 13:31:54 -03:00
committed by GitHub
parent 5731241a5c
commit 24b18fb0fd
26 changed files with 277 additions and 68 deletions

View File

@@ -27,7 +27,17 @@ export const collectionEndpoints: CollectionConfig['endpoints'] = [
{
path: '/whoami',
method: 'post',
handler: (req) => {
handler: async (req) => {
let data
try {
data = await req.json()
} catch (error) {
data = {}
}
if (data) req.data = data
return Response.json({
name: req.data.name,
age: req.data.age,