feat: adds maxDepth to relationships and upload fields
This commit is contained in:
@@ -60,7 +60,7 @@ const accessPromise = async ({
|
||||
relationshipPopulations.push(relationshipPopulationPromise({
|
||||
data,
|
||||
field,
|
||||
depth,
|
||||
depth: field.maxDepth || depth,
|
||||
currentDepth,
|
||||
req,
|
||||
overrideAccess,
|
||||
|
||||
@@ -171,6 +171,7 @@ export const upload = baseField.keys({
|
||||
type: joi.string().valid('upload').required(),
|
||||
relationTo: joi.string().required(),
|
||||
name: joi.string().required(),
|
||||
maxDepth: joi.number(),
|
||||
});
|
||||
|
||||
export const checkbox = baseField.keys({
|
||||
@@ -187,6 +188,7 @@ export const relationship = baseField.keys({
|
||||
joi.array().items(joi.string()),
|
||||
),
|
||||
name: joi.string().required(),
|
||||
maxDepth: joi.number(),
|
||||
});
|
||||
|
||||
export const blocks = baseField.keys({
|
||||
|
||||
@@ -141,6 +141,7 @@ export type RowField = FieldBase & {
|
||||
export type UploadField = FieldBase & {
|
||||
type: 'upload';
|
||||
relationTo: string;
|
||||
maxDepth?: number;
|
||||
}
|
||||
|
||||
type CodeAdmin = Admin & {
|
||||
@@ -164,6 +165,7 @@ export type RelationshipField = FieldBase & {
|
||||
type: 'relationship';
|
||||
relationTo: string | string[];
|
||||
hasMany?: boolean;
|
||||
maxDepth?: number;
|
||||
}
|
||||
|
||||
type RichTextPlugin = (editor: Editor) => Editor;
|
||||
|
||||
Reference in New Issue
Block a user