* fix: adds RTE provider, to allow for disabledRTE relationships from breaking other drawers * chore: updates hook name * chore: simplifies list drawer rendering * chore: simplify types * chore: adds arg to determine what listType drawer to render * chore: renames listType to contentType, fix upload field drawer * chore: requires collectionSlugs in useListDrawer * chore(test): adds tests for list drawers, relationships and uploads * chore: formatting * chore: cleans up types, collectionSlugs are required for useListDrawer * chore: removes RichTextProvider * chore: removes hoc in favor of FC hoc * chore: fixes fc hoc
36 lines
624 B
TypeScript
36 lines
624 B
TypeScript
import path from 'path';
|
|
import { CollectionConfig } from '../../../../src/collections/config/types';
|
|
|
|
const Uploads: CollectionConfig = {
|
|
slug: 'uploads',
|
|
upload: {
|
|
staticDir: path.resolve(__dirname, './uploads'),
|
|
},
|
|
fields: [
|
|
{
|
|
type: 'text',
|
|
name: 'text',
|
|
},
|
|
{
|
|
type: 'upload',
|
|
name: 'media',
|
|
relationTo: 'uploads',
|
|
filterOptions: {
|
|
mimeType: {
|
|
equals: 'image/png',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
type: 'richText',
|
|
name: 'richText',
|
|
},
|
|
],
|
|
};
|
|
|
|
export const uploadsDoc = {
|
|
text: 'An upload here',
|
|
};
|
|
|
|
export default Uploads;
|