From 3e3dc4c22d765d7eea1d38e9f85c913982c656b6 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 16 Aug 2024 01:19:13 +0800 Subject: [PATCH] chore: fix ci problem --- src/client/routes/survey/add.tsx | 3 +-- src/client/utils/survey.spec.ts | 2 -- src/client/utils/survey.ts | 8 +++++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client/routes/survey/add.tsx b/src/client/routes/survey/add.tsx index 466e29f..8808273 100644 --- a/src/client/routes/survey/add.tsx +++ b/src/client/routes/survey/add.tsx @@ -26,9 +26,8 @@ function PageComponent() { const onSubmit = useEvent(async (values: SurveyEditFormValues) => { const res = await createMutation.mutateAsync({ + ...values, workspaceId, - name: values.name, - payload: values.payload, }); utils.survey.all.refetch(); diff --git a/src/client/utils/survey.spec.ts b/src/client/utils/survey.spec.ts index 0381b4e..32bb934 100644 --- a/src/client/utils/survey.spec.ts +++ b/src/client/utils/survey.spec.ts @@ -17,8 +17,6 @@ describe('survey', () => { }, ], }, - createdAt: '', - updatedAt: '', }) ).matchSnapshot(); }); diff --git a/src/client/utils/survey.ts b/src/client/utils/survey.ts index 1cd3335..b74cd96 100644 --- a/src/client/utils/survey.ts +++ b/src/client/utils/survey.ts @@ -5,7 +5,13 @@ import { AppRouterOutput } from '@/api/trpc'; */ export function generateSurveyExampleCode( host: string, - info?: AppRouterOutput['survey']['get'] + info: + | Pick< + NonNullable, + 'id' | 'name' | 'workspaceId' | 'payload' + > + | null + | undefined ): string { const fields = info?.payload.items ?? [];