Skip to content

Commit

Permalink
rename handler functions in login and register pages to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
juditta99 committed Mar 30, 2024
1 parent f97136c commit 0f658e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions staff/judy-grayland/project/app/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Login(props) {
navigate('/')
}

function authenticateUser(event) {
function handleSubmit(event) {
event.preventDefault()

const formData = new FormData(event.currentTarget)
Expand All @@ -35,8 +35,8 @@ function Login(props) {

return (
<>
<h1>Login</h1>
<Form onSubmit={authenticateUser}>
<h1>Inicia sesión</h1>
<Form onSubmit={handleSubmit}>
<Field name="email" inputId="email-input"></Field>
<Field name="password" inputId="password-input"></Field>
<Button type="submit">Iniciar sesión</Button>
Expand Down
4 changes: 2 additions & 2 deletions staff/judy-grayland/project/app/src/pages/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Register(props) {
console.log('user successfully registered')
navigate('/login')
}
function registerNewUser(event) {
function handleSubmit(event) {
event.preventDefault()

const formData = new FormData(event.currentTarget)
Expand All @@ -40,7 +40,7 @@ function Register(props) {
return (
<>
<h1>Register</h1>
<Form onSubmit={registerNewUser}>
<Form onSubmit={handleSubmit}>
<Field name="name" inputId="name-input">
Nombre
</Field>
Expand Down

0 comments on commit 0f658e6

Please sign in to comment.