From 675b4b6925cdee236a009802dd21721074ae0142 Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Sun, 10 Nov 2024 21:47:20 -0700 Subject: [PATCH] tidy: cleanup logs/comments, move calls --- web/src/components/EditResponseCell/EditResponseCell.tsx | 5 ++--- web/src/components/NewResponseForm/NewResponseForm.tsx | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/components/EditResponseCell/EditResponseCell.tsx b/web/src/components/EditResponseCell/EditResponseCell.tsx index 931f25a..e0a0db2 100644 --- a/web/src/components/EditResponseCell/EditResponseCell.tsx +++ b/web/src/components/EditResponseCell/EditResponseCell.tsx @@ -84,8 +84,6 @@ export const Success = ({ response, }: CellSuccessProps) => { const { editToken, event, ...defaultValues } = response - const [deleting, setDeleting] = useState(false) - const [updateSuccess, setUpdateSuccess] = useState(false) const formMethods = useForm({ mode: 'onTouched', @@ -117,8 +115,9 @@ export const Success = ({ }, }) + const [deleting, setDeleting] = useState(false) + const [updateSuccess, setUpdateSuccess] = useState(false) const loading = saving || deleting - // if (formState.isDirty) setUpdateSuccess(false) return ( <> diff --git a/web/src/components/NewResponseForm/NewResponseForm.tsx b/web/src/components/NewResponseForm/NewResponseForm.tsx index cb46b8a..a4906b7 100644 --- a/web/src/components/NewResponseForm/NewResponseForm.tsx +++ b/web/src/components/NewResponseForm/NewResponseForm.tsx @@ -78,7 +78,6 @@ const NewResponseForm = (props: Props) => { onSubmit={(data: FormValues) => { if (!data.email) throw new Error('Email is required') const input = { ...data, email: data.email } - console.log(input) create({ variables: { eventId: event.id, input } }) }} />