feat(cms): migrate from directus to payloadcms
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 2m55s
Build & Deploy / 🏗️ Build (push) Successful in 11m40s
Build & Deploy / 🚀 Deploy (push) Failing after 8s
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 2m55s
Build & Deploy / 🏗️ Build (push) Successful in 11m40s
Build & Deploy / 🚀 Deploy (push) Failing after 8s
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
This commit is contained in:
44
src/payload/collections/FormSubmissions.ts
Normal file
44
src/payload/collections/FormSubmissions.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import type { CollectionConfig } from "payload";
|
||||
|
||||
export const FormSubmissions: CollectionConfig = {
|
||||
slug: "form-submissions",
|
||||
admin: {
|
||||
useAsTitle: "name",
|
||||
defaultColumns: ["name", "email", "company", "createdAt"],
|
||||
description: "Captured leads from Contact Form.",
|
||||
},
|
||||
access: {
|
||||
read: ({ req: { user } }) =>
|
||||
Boolean(user) || process.env.NODE_ENV === "development",
|
||||
update: ({ req: { user } }) =>
|
||||
Boolean(user) || process.env.NODE_ENV === "development",
|
||||
delete: ({ req: { user } }) =>
|
||||
Boolean(user) || process.env.NODE_ENV === "development",
|
||||
create: () => false, // Only system creates submissions
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: "name",
|
||||
type: "text",
|
||||
required: true,
|
||||
admin: { readOnly: true },
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
type: "email",
|
||||
required: true,
|
||||
admin: { readOnly: true },
|
||||
},
|
||||
{
|
||||
name: "company",
|
||||
type: "text",
|
||||
admin: { readOnly: true },
|
||||
},
|
||||
{
|
||||
name: "message",
|
||||
type: "textarea",
|
||||
required: true,
|
||||
admin: { readOnly: true },
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user