(data: QuestionSchema)
| 38 | }, [questionToUpdate, reset]) |
| 39 | |
| 40 | const onSubmit = (data: QuestionSchema) => { |
| 41 | startTransition(async () => { |
| 42 | if (questionToUpdate) { |
| 43 | const {error} = await updateQuestion(data, questionToUpdate.id); |
| 44 | if (error) handleError(error); |
| 45 | router.push(`/questions/${questionToUpdate.id}`); |
| 46 | } else { |
| 47 | const {data: question, error} = await postQuestion(data); |
| 48 | if (error) handleError(error); |
| 49 | if (question) router.push(`/questions/${question.id}`); |
| 50 | } |
| 51 | }) |
| 52 | } |
| 53 | |
| 54 | return ( |
| 55 | <Form onSubmit={handleSubmit(onSubmit)} |
nothing calls this directly
no test coverage detected
searching dependent graphs…