fix(db-postgres): allow the same block slug in different places with a different localized value (#12414)
Fixes https://github.com/payloadcms/payload/issues/12409 Now Payload automatically resolves table names conflicts in those cases, as well as Drizzle relation names. --------- Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
This commit is contained in:
@@ -2515,4 +2515,17 @@ describe('database', () => {
|
||||
|
||||
expect(result_2.totalDocs).toBe(0)
|
||||
})
|
||||
|
||||
it('can have localized and non localized blocks', async () => {
|
||||
const res = await payload.create({
|
||||
collection: 'blocks-docs',
|
||||
data: {
|
||||
testBlocks: [{ blockType: 'cta', text: 'text' }],
|
||||
testBlocksLocalized: [{ blockType: 'cta', text: 'text-localized' }],
|
||||
},
|
||||
})
|
||||
|
||||
expect(res.testBlocks[0]?.text).toBe('text')
|
||||
expect(res.testBlocksLocalized[0]?.text).toBe('text-localized')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user