Files
payload/test/fields/collections/Upload/index.ts
Patrik cb5d005e68 test: passing array fields test suite (#5383)
* test: array tests passing except bulk update

* test: passing array fields test suite
2024-03-20 12:00:56 -04:00

38 lines
712 B
TypeScript

import type { CollectionConfig } from 'payload/types'
import path from 'path'
import { fileURLToPath } from 'url'
import { uploadsSlug } from '../../slugs.js'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
const Uploads: CollectionConfig = {
slug: uploadsSlug,
upload: {
staticDir: path.resolve(dirname, './uploads'),
},
fields: [
{
type: 'text',
name: 'text',
},
{
type: 'upload',
name: 'media',
relationTo: uploadsSlug,
filterOptions: {
mimeType: {
equals: 'image/png',
},
},
},
{
type: 'richText',
name: 'richText',
},
],
}
export default Uploads