Skip to content

Commit

Permalink
Remove deprecated useMutation utility and update error handling in Qu…
Browse files Browse the repository at this point in the history
…estionnaireForm
  • Loading branch information
abhimanyurajeesh committed Jan 8, 2025
1 parent 51197b7 commit ace9e7a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
50 changes: 0 additions & 50 deletions src/Utils/request/useMutation.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/components/Questionnaire/QuestionnaireForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Loading from "@/components/Common/Loading";

import routes from "@/Utils/request/api";
import mutate from "@/Utils/request/mutate";
import { HTTPError } from "@/Utils/request/types";
import useQuery from "@/Utils/request/useQuery";
import {
DetailedValidationError,
Expand Down Expand Up @@ -85,7 +84,7 @@ export function QuestionnaireForm({
toast.success(t("questionnaire_submitted_successfully"));
onSubmit?.();
},
onError: (error: HTTPError) => {
onError: (error) => {
const errorData = error.cause;
if (errorData?.results) {
handleSubmissionError(errorData.results as ValidationErrorResponse[]);
Expand Down

0 comments on commit ace9e7a

Please sign in to comment.