chore: adjusts block and array schemas to store undefined instead of empty arrays by default

This commit is contained in:
Jarrod Flesch
2023-01-06 16:56:26 -05:00
parent 7b769caf78
commit 001a68f45c
4 changed files with 33 additions and 19 deletions

View File

@@ -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 () => {