Supports `hasMany` upload fields, similar to how `hasMany` works in
other fields, i.e.:
```ts
{
type: 'upload',
relationTo: 'media',
hasMany: true
}
```
---------
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: James <james@trbl.design>
21 lines
378 B
TypeScript
21 lines
378 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { uploads2Slug, uploadsPoly, uploadsSlug } from '../../slugs.js'
|
|
|
|
const Uploads: CollectionConfig = {
|
|
slug: uploadsPoly,
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'media',
|
|
type: 'upload',
|
|
relationTo: [uploadsSlug, uploads2Slug],
|
|
},
|
|
],
|
|
}
|
|
|
|
export default Uploads
|