-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
status: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet
Description
Describe the Bug
I'm currently building a plugin for translating the content of a page via GPT and the most efficient way would be to update multiple languages at once. Do you may know if there is a way to achieve this or if I should work directly with the mongooseAdapter?
The plugin: https://github.com/wirewirewirewire/payload-ai
const updatedLanguage = await req.payload.update({
// req,
collection: collection.slug,
id: doc.id,
data: {
content: {
en: 'English content',
es: 'Spanish content',
},
},
locale: 'all',
})
}This doesn't throw an error but also does not update the content.
Many thanks for building Payload! :)
To Reproduce
Any update using the local API with locale="all" set.
const result = await req.payload.update({
// req,
collection: collection.slug,
id: doc.id,
data: {
content: {
en: 'English content',
es: 'Spanish content',
},
},
locale: 'all',
})
}The result will return the unchanged content, but the expected output would be:
{
"content": {
"en": "English content",
"es": "Spanish content",
}
}Payload Version
2.6.2
Adapters and Plugins
localization
Metadata
Metadata
Assignees
Labels
status: needs-triagePossible bug which hasn't been reproduced yetPossible bug which hasn't been reproduced yet