-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug de submit de form vazio #16
base: master
Are you sure you want to change the base?
Conversation
Externalizei a validação em uma função que aceita um array de campos a ser validados e os campos preenchidos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guiluchesi desculpa a demora infinita para revisar ): tenho só duas observações para corrigir.
@@ -7,6 +7,7 @@ | |||
"react": "^16.5.2", | |||
"react-dom": "^16.5.2", | |||
"react-scripts": "2.0.5", | |||
"styled-components": "^4.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Faltou uma virgulinha aqui.
@@ -3,13 +3,26 @@ import React, { Component } from 'react'; | |||
import CharacterForm from './components/CharacterForm'; | |||
import InitiativeList from './components/InitiativeList'; | |||
|
|||
const isFormFilled = (values, requiredFields) => !requiredFields | |||
.map(field => values[field] ? true : false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Que tal mudar para field => Boolean(values[field])
?
No description provided.