Skip to content

Commit

Permalink
Redirect on updating questionnaire (#10796)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sulochan-khadka authored Feb 26, 2025
1 parent fde54b3 commit c097957
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Questionnaire/QuestionnaireEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,10 @@ export default function QuestionnaireEditor({ id }: QuestionnaireEditorProps) {
mutationFn: mutate(questionnaireApi.update, {
pathParams: { id: id! },
}),
onSuccess: () => {
onSuccess: (data: QuestionnaireDetail) => {
toast.success("Questionnaire updated successfully");
queryClient.invalidateQueries({ queryKey: ["questionnaireDetail", id] });
navigate(`/admin/questionnaire/${data.slug}`);
},
onError: (_error) => {
toast.error("Failed to update questionnaire");
Expand Down

0 comments on commit c097957

Please sign in to comment.