I am trying to create/update using local api but getting TypeError: Cannot read properties of undefined (reading 'config').
Code:
const post = await payload.create({
collection: 'Hhh', // required
data: {
// required
title: 'Hhh',
},
});
Found the solution! I had to include the user info
const createResult = await payload.create({
collection: modelSlug, // required
data: {
// required
title: modelSlug,
...doc,
},
user: {
id: req.user.id,
collection: req.user.collection,
},
});
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.