chore: better organizes collection preview

This commit is contained in:
James
2020-12-28 17:20:29 -05:00
parent 2856e0213f
commit 6df3b381ef
7 changed files with 15 additions and 28 deletions

View File

@@ -46,9 +46,9 @@ const DefaultEditView: React.FC<Props> = (props) => {
admin: {
useAsTitle,
disableDuplicate,
preview,
},
timestamps,
preview,
auth,
upload,
} = collection;

View File

@@ -12,7 +12,6 @@ const collectionSchema = joi.object().keys({
singular: joi.string(),
plural: joi.string(),
}),
preview: joi.func(),
access: joi.object({
create: joi.func(),
read: joi.func(),
@@ -32,6 +31,7 @@ const collectionSchema = joi.object().keys({
Edit: component,
}),
}),
preview: joi.func(),
}),
fields: joi.array()
.items(fieldSchema),

View File

@@ -108,8 +108,8 @@ export type PayloadCollectionConfig = {
}
};
enableRichTextRelationship?: boolean
preview?: (doc: Document, token: string) => string
};
preview?: (doc: Document, token: string) => string
hooks?: {
beforeOperation?: BeforeOperationHook[];
beforeValidate?: BeforeValidateHook[];