changed username to name in state in reg.jsx
This commit is contained in:
parent
f48962b034
commit
bc7397e5fa
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue