Merge pull request #1719 from payloadcms/feat/1695-nullable-localized-array-and-blocks
Feat: allow null for non-default locales on arrays and blocks
This commit is contained in:
@@ -61,6 +61,7 @@ export default buildConfig({
|
||||
localization: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'es'],
|
||||
fallback: true,
|
||||
},
|
||||
onInit: async (payload) => {
|
||||
await payload.create({
|
||||
|
||||
@@ -274,13 +274,13 @@ describe('Fields', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should return empty array for arrays when no data present', async () => {
|
||||
it('should return undefined arrays when no data present', async () => {
|
||||
const document = await payload.create<ArrayField>({
|
||||
collection: arrayFieldsSlug,
|
||||
data: arrayDoc,
|
||||
});
|
||||
|
||||
expect(document.potentiallyEmptyArray).toEqual([]);
|
||||
expect(document.potentiallyEmptyArray).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should create with ids and nested ids', async () => {
|
||||
|
||||
Reference in New Issue
Block a user