changed username to name in state in reg.jsx

This commit is contained in:
Anirban-1490 2022-05-16 21:06:51 +05:30
parent f48962b034
commit bc7397e5fa
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ function Reg() {
const router = useRouter()
const context = useContext(UserAuth)
const [userData, setUserData] = useState({
username: '',
name: '',
email: '',
password: '',
repassword: '',
@ -45,10 +45,10 @@ function Reg() {
</div>
<input
className="reg-input"
name="username"
name="name"
autoComplete="off"
type="text"
value={userData.username}
value={userData.name}
onChange={handleInput}
placeholder="Full Name"
/>

View File

@ -49,13 +49,13 @@ const UserAuthProvider = ({ children }) => {
})
return login
}
const createAcc = async ({ email, password, username }) => {
const createAcc = async ({ email, password, name }) => {
let register = true
await axios
.post(`/user/register`, {
email: email,
password: password,
name: username,
name: name,
})
.then(function (response) {
console.log(response)