标签: payload-cms

我遇到 PayloadCMS 错误。验证错误:以下字段无效:电子邮件

我使用创建了一个有效负载应用程序, npx create-payload-app 并选择使用空白模板

我有这个。验证错误:以下字段无效:电子邮件

src/seed/index.ts

import { Payload } from 'payload';
import { customerForm } from './customerForm';

export const seed = async (payload: Payload) => {
  const customerFormJSON = JSON.parse(JSON.stringify(customerForm));

  const { id: customerFormID } = await payload.create({
    collection: 'customer', 
    data: customerFormJSON,
  });

};
Run Code Online (Sandbox Code Playgroud)

src/seed/customerForm.ts

export const customerForm = {
    id: '63c0651b132c8e2783f8dcae',
    updatedAt: '2023-01-12T21:25:41.113Z',
    createdAt: '2022-12-28T20:48:53.181Z',
    title: 'Customer Form',
    fields: [
      {
        name: 'firstName',
        label: 'First name',
        width: 50,
        required: true,
        id: '63adaaba5236fe69ca8973f8',
        blockName: 'first-name',
        blockType: 'text',
      },
      { …
Run Code Online (Sandbox Code Playgroud)

javascript content-management-system node.js typescript payload-cms

3
推荐指数
1
解决办法
1678
查看次数