chore: adjusts block and array schemas to store undefined instead of empty arrays by default
This commit is contained in:
@@ -57,6 +57,7 @@ export default buildConfig({
|
||||
localization: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'es'],
|
||||
fallback: true,
|
||||
},
|
||||
onInit: async (payload) => {
|
||||
await payload.create({
|
||||
|
||||
@@ -276,13 +276,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