diff --git a/src/client/components/monitor/StatusPage/EditForm.tsx b/src/client/components/monitor/StatusPage/EditForm.tsx index 11b0708..98ea0e5 100644 --- a/src/client/components/monitor/StatusPage/EditForm.tsx +++ b/src/client/components/monitor/StatusPage/EditForm.tsx @@ -10,6 +10,7 @@ const { Text } = Typography; export interface MonitorStatusPageEditFormValues { title: string; slug: string; + monitorList: PrismaJson.MonitorStatusPageList; } interface MonitorStatusPageEditFormProps { diff --git a/src/client/pages/Monitor/PageAdd.tsx b/src/client/pages/Monitor/PageAdd.tsx index ad95bb9..a25ff42 100644 --- a/src/client/pages/Monitor/PageAdd.tsx +++ b/src/client/pages/Monitor/PageAdd.tsx @@ -3,12 +3,10 @@ import { useNavigate } from 'react-router'; import { useCurrentWorkspaceId } from '../../store/user'; import { trpc } from '../../api/trpc'; import { useEvent } from '../../hooks/useEvent'; -import { MonitorStatusPageEditForm } from '../../components/monitor/StatusPage/EditForm'; - -interface Values { - title: string; - slug: string; -} +import { + MonitorStatusPageEditForm, + MonitorStatusPageEditFormValues, +} from '../../components/monitor/StatusPage/EditForm'; export const MonitorPageAdd: React.FC = React.memo(() => { const workspaceId = useCurrentWorkspaceId()!; @@ -17,17 +15,18 @@ export const MonitorPageAdd: React.FC = React.memo(() => { const createPageMutation = trpc.monitor.createPage.useMutation(); const trpcUtils = trpc.useContext(); - const handleFinish = useEvent(async (values: Values) => { - await createPageMutation.mutateAsync({ - workspaceId, - title: values.title, - slug: values.slug, - }); + const handleFinish = useEvent( + async (values: MonitorStatusPageEditFormValues) => { + await createPageMutation.mutateAsync({ + ...values, + workspaceId, + }); - trpcUtils.monitor.getAllPages.refetch(); + trpcUtils.monitor.getAllPages.refetch(); - navigate('/monitor/pages'); - }); + navigate('/monitor/pages'); + } + ); return (