react-code-dataset / Reactive-Resume /apps /client /src /services /auth /two-factor-authentication /disable.ts
Download Reactive-Resume/apps/client/src/services/auth/two-factor-authentication/disable.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Reactive-Resume/apps/client/src/services/auth/two-factor-authentication/disable.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Reactive-Resume/apps/client/src/services/auth/two-factor-authentication/disable.ts
-
curl -L -o disable.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Reactive-Resume/apps/client/src/services/auth/two-factor-authentication/disable.ts
592 Bytes
| import type { MessageDto } from "@reactive-resume/dto"; | |
| import { useMutation } from "@tanstack/react-query"; | |
| import type { AxiosResponse } from "axios"; | |
| import { axios } from "@/client/libs/axios"; | |
| export const disable2FA = async () => { | |
| const response = await axios.post<MessageDto, AxiosResponse<MessageDto>>("/auth/2fa/disable"); | |
| return response.data; | |
| }; | |
| export const useDisable2FA = () => { | |
| const { | |
| error, | |
| isPending: loading, | |
| mutateAsync: disable2FAFn, | |
| } = useMutation({ | |
| mutationFn: disable2FA, | |
| }); | |
| return { disable2FA: disable2FAFn, loading, error }; | |
| }; | |