diff --git a/apps/bridge-frontend/app/(main)/[...segment]/@create/_components/Create.tsx b/apps/bridge-frontend/app/(main)/[...segment]/@create/_components/Create.tsx index 3c2fd28..425c983 100644 --- a/apps/bridge-frontend/app/(main)/[...segment]/@create/_components/Create.tsx +++ b/apps/bridge-frontend/app/(main)/[...segment]/@create/_components/Create.tsx @@ -3,10 +3,10 @@ import { FC } from "react"; import { useFormState } from "react-dom"; import { Grid } from "@mui/material"; -import { TextField } from "ui"; +import { TextField, Select, MultiValueField } from "ui"; import { Create as InternalCreate } from "@/app/_components/Create"; import { generateCreateAction } from "@/app/_lib/actions"; -import { serviceConfig } from "@/app/_lib/config"; +import { serviceConfig } from "@/app/_config/config"; import { FieldDescription } from "@/app/_lib/service"; type CreateProps = { @@ -15,8 +15,18 @@ type CreateProps = { export const Create: FC = ({ service }) => { const { - [service]: { entity, table, displayName, createFields: fields }, + [service]: { entity, table, displayName, createFields }, } = serviceConfig; + const fields = createFields.map((field: any) => { + const copy = { ...field }; + Object.keys(copy).forEach((key: any) => { + if (typeof copy[key] === "function") { + delete copy[key]; + } + }); + return copy; + }); + const createAction = generateCreateAction({ entity, table, fields }); const initialState = { message: null, @@ -39,18 +49,37 @@ export const Create: FC = ({ service }) => { formState={formState} > - {fields.map( + {createFields.map( (field) => !field.hidden && ( - + {field.kind === "select" && ( +