example frontend-backend communication

This commit is contained in:
2025-09-24 20:19:58 +02:00
parent bf9ae5f01f
commit bba4044eaf
13 changed files with 412 additions and 33 deletions
@@ -5,6 +5,7 @@ import InputBox from "../../components/Inputs/InputBox";
import Button from "../../components/Buttons/Button";
import { motion } from "framer-motion";
import { useState } from "react";
import { login } from "../../api/userApi";
export default function LoginForm() {
const [email, setEmail] = useState("");
@@ -27,7 +28,14 @@ export default function LoginForm() {
return;
}
// Backend API
console.log("Bejelentkezés:", { email, password });
login(email, password)
.then((data) => {
console.log(data);
console.log("Bejelentkezés:", { email, password });
})
.catch((error) => {
setError("Hibás bejelentkezési adatok.");
});
};
return (