chore: merge from 2.0

This commit is contained in:
Elliot DeNolf
2023-09-14 12:10:36 -04:00
2597 changed files with 96505 additions and 105649 deletions

View File

@@ -1,7 +1,9 @@
/* eslint-disable no-param-reassign */
import { Field } from 'payload/types';
import { traverseFields } from './traverseFields';
import { RowToInsert } from './types';
import type { Field } from 'payload/types'
import type { RowToInsert } from './types'
import { traverseFields } from './traverseFields'
type Args = {
data: Record<string, unknown>
@@ -22,9 +24,8 @@ export const transformForWrite = ({
row: {},
locales: {},
relationships: [],
blocks: {},
arrays: {},
};
row: {},
}
// This function is responsible for building up the
// above rowToInsert
@@ -40,7 +41,7 @@ export const transformForWrite = ({
path,
relationships: rowToInsert.relationships,
row: rowToInsert.row,
});
})
return rowToInsert;
};
return rowToInsert
}

View File

@@ -159,7 +159,7 @@ export const traverseFields = ({
path: `${path || ''}${field.name}.`,
relationships,
row,
});
})
}
}
@@ -320,5 +320,5 @@ export const traverseFields = ({
}
});
}
});
};
})
}

View File

@@ -7,6 +7,9 @@ export type ArrayRowToInsert = {
arrays: {
[tableName: string]: ArrayRowToInsert[]
}
columnName: string
locale: Record<string, unknown>
row: Record<string, unknown>
}
export type BlockRowToInsert = {
@@ -17,6 +20,8 @@ export type BlockRowToInsert = {
arrays: {
[tableName: string]: ArrayRowToInsert[]
}
locale: Record<string, unknown>
row: Record<string, unknown>
}
export type RowToInsert = {
@@ -31,4 +36,10 @@ export type RowToInsert = {
arrays: {
[tableName: string]: ArrayRowToInsert[]
}
blocks: {
[blockType: string]: BlockRowToInsert[]
}
locale: Record<string, unknown>
relationships: Record<string, unknown>[]
row: Record<string, unknown>
}