Guys I can't seem to figure it out. I created a custom form checkbox field and I can't save it do DB, it only saves blockType somehow. Weird thing is it works on local but not in production. Here is the output from API:
"id": "6507e3eac11f68a6b39b29de",
"title": "Kontakt",
"fields": [
{
"blockType": "multiple-checkbox"
},
{
"name": "text",
"label": "Text Input",
"required": true,
"id": "650809c27c5f1eb8b1fa2ba9",
"blockType": "text"
}
],
and here is my custom input code:
import { DefaultFieldProps } from "./default-field-props";
import { FieldRequired } from "./options";
import { Block } from "payload/types";
export const MultipleCheckbox: Block = {
slug: "multiple-checkbox",
interfaceName: "MultipleCheckboxField",
labels: {
singular: "Pole wyboru",
plural: "Pola wyboru",
},
fields: [
{
type: "row",
fields: [
...DefaultFieldProps,
{
name: "options",
label: "Opcje",
labels: {
singular: "Opcja",
plural: "Opcje",
},
type: "array",
fields: [
{
name: "option",
label: "Opcja",
type: "text",
},
],
},
],
},
FieldRequired,
],
};
Weird thing, locally it is visible under /dist/fields/forms but at production it isn't building it.
Fixed, unrelated with Payload. It was a wrong tsconfig.json configuration which messed with build. We needed to delete dist and build folders at production, then we saw errors.
Hey
@432257066292346882glad you got this sorted out! We're around if you need anything else.
All good mate, thanks! It was wrong configuration with react-email building, two folders went into dist -> src and react-email, so payload was building into src instead of straight into dist.
that makes sense!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.