🆙 Update React Query to TanStack Query (#1153)

This commit is contained in:
Patrick Arminio
2024-04-04 16:30:42 +02:00
committed by GitHub
parent 3628e039f8
commit 2314dbd2df
19 changed files with 225 additions and 517 deletions

View File

@@ -10,7 +10,7 @@ import {
} from "@chakra-ui/react"
import { createFileRoute, redirect, useNavigate } from "@tanstack/react-router"
import { type SubmitHandler, useForm } from "react-hook-form"
import { useMutation } from "react-query"
import { useMutation } from "@tanstack/react-query"
import { type ApiError, LoginService, type NewPassword } from "../client"
import { isLoggedIn } from "../hooks/useAuth"
@@ -57,7 +57,8 @@ function ResetPassword() {
})
}
const mutation = useMutation(resetPassword, {
const mutation = useMutation({
mutationFn: resetPassword,
onSuccess: () => {
showToast("Success!", "Password updated.", "success")
reset()