diff --git a/daily-thought-frontend/src/components/questions/NewQuestionForm.tsx b/daily-thought-frontend/src/components/questions/NewQuestionForm.tsx index 2f5118ca5a3c2b99244bd8ed6bccdbd1f04b4b9a..1023776689afc4e9469a0fa0d6847dd656b90adf 100644 --- a/daily-thought-frontend/src/components/questions/NewQuestionForm.tsx +++ b/daily-thought-frontend/src/components/questions/NewQuestionForm.tsx @@ -3,7 +3,7 @@ import { Dispatch, FC, FormEvent, SetStateAction } from 'react'; type NewQuestionFormProps = { newQuestion: string; setNewQuestion: Dispatch<SetStateAction<string>>; - onSubmit: () => void; + onSubmit: () => Promise<void>; }; const NewQuestionForm: FC<NewQuestionFormProps> = ({ newQuestion, setNewQuestion, onSubmit }) => { diff --git a/daily-thought-frontend/src/pages/questions.tsx b/daily-thought-frontend/src/pages/questions.tsx index 9e57b67a2cb6ae43da7c4a7526b95cc01786d40f..bc163a956681c6048503eec307910d5417b749d1 100644 --- a/daily-thought-frontend/src/pages/questions.tsx +++ b/daily-thought-frontend/src/pages/questions.tsx @@ -24,8 +24,8 @@ const Questions = () => { await fetch(endpoint, options); }; - const onQuestionSubmit = (): void => { - insertNewQuestion(newQuestion); + const onQuestionSubmit = async (): Promise<void> => { + await insertNewQuestion(newQuestion); setRehydrateQuestions(true); };