Files
payload/test/fields/collections/Text/index.ts
2022-07-18 14:25:18 -04:00

38 lines
746 B
TypeScript

import type { CollectionConfig } from '../../../../src/collections/config/types';
export const defaultText = 'default-text';
const TextFields: CollectionConfig = {
slug: 'text-fields',
admin: {
useAsTitle: 'text',
},
fields: [
{
name: 'text',
type: 'text',
required: true,
},
{
name: 'defaultFunction',
type: 'text',
defaultValue: () => (defaultText),
},
{
name: 'defaultAsync',
type: 'text',
defaultValue: async (): Promise<string> => {
return new Promise((resolve) => setTimeout(() => {
resolve(defaultText);
}, 1));
},
},
],
};
export const textDoc = {
text: 'Seeded text document',
};
export default TextFields;