qazaq-legacy-foundation-web/src/collections/Inquiries.ts
Peppa 31a5190b7a
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 1с
peppa/build build: success за 35с
ci / checks (pull_request) Successful in 1m26s
deploy / deploy (pull_request) Successful in 2m8s
QLFW-15: форма обращения, страница контактов, сохранение и отправка обращений
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 10:26:13 +05:00

18 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { CollectionConfig } from 'payload'
/** Обращения с сайта. Создаются только сервером сайта; читать и править — только вошедшим сотрудникам фонда. */
export const Inquiries: CollectionConfig = {
slug: 'inquiries',
labels: { singular: 'Обращение', plural: 'Обращения' },
admin: { useAsTitle: 'name', defaultColumns: ['name', 'email', 'organization', 'createdAt', 'emailed'] },
access: { create: () => false, read: ({ req }) => Boolean(req.user), update: ({ req }) => Boolean(req.user), delete: ({ req }) => Boolean(req.user) },
fields: [
{ name: 'name', label: 'Имя', type: 'text', required: true },
{ name: 'email', label: 'Почта', type: 'email', required: true },
{ name: 'organization', label: 'Организация', type: 'text' },
{ name: 'message', label: 'Текст обращения', type: 'textarea', required: true },
{ name: 'locale', label: 'Язык сайта', type: 'text' },
{ name: 'emailed', label: 'Письмо фонду отправлено', type: 'checkbox', defaultValue: false },
],
}