26 lines
898 B
TypeScript
26 lines
898 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
import { ADMIN_GROUP } from '../admin/groups'
|
|
|
|
export const Gallery: CollectionConfig = {
|
|
slug: 'gallery',
|
|
labels: { singular: 'Фото', plural: 'Галерея' },
|
|
admin: { group: ADMIN_GROUP.content, useAsTitle: 'title' },
|
|
access: { read: () => true },
|
|
fields: [
|
|
{ name: 'title', type: 'text', required: true, localized: true },
|
|
{ name: 'image', type: 'upload', relationTo: 'media', required: true },
|
|
{
|
|
name: 'category',
|
|
type: 'select',
|
|
options: [
|
|
{ label: 'Клиника', value: 'clinic' },
|
|
{ label: 'Оборудование', value: 'equipment' },
|
|
{ label: 'События', value: 'events' },
|
|
],
|
|
defaultValue: 'clinic',
|
|
},
|
|
{ name: 'branch', type: 'relationship', relationTo: 'branches' },
|
|
{ name: 'sortOrder', type: 'number', defaultValue: 0 },
|
|
],
|
|
}
|