Download Amazon-Clone-PERN-stack/src/components/RequestUser/ForLogIn.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 404 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Amazon-Clone-PERN-stack/src/components/RequestUser/ForLogIn.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Amazon-Clone-PERN-stack/src/components/RequestUser/ForLogIn.js
-
curl -L -o ForLogIn.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Amazon-Clone-PERN-stack/src/components/RequestUser/ForLogIn.js
404 Bytes
| import axios from "axios"; | |
| import { logInUrl } from "./../../urls"; | |
| export const reqToLogIn = async (formData) => { | |
| try { | |
| const { data } = await axios({ | |
| url: logInUrl(), | |
| method: "post", | |
| data: formData, | |
| }); | |
| return data; | |
| } catch (e) { | |
| console.log(e.response); | |
| if (e.response.status === 401 || e.response.status === 500) { | |
| alert(e.response.data); | |
| } | |
| return; | |
| // alert() | |
| } | |
| }; | |