Skip to content

Fix bug de submit de form vazio - #16

Open
luchesigui wants to merge 14 commits into
hack-and-slash:masterfrom
luchesigui:fix/form-vazio
Open

Fix bug de submit de form vazio#16
luchesigui wants to merge 14 commits into
hack-and-slash:masterfrom
luchesigui:fix/form-vazio

Conversation

@luchesigui

Copy link
Copy Markdown
Contributor

No description provided.

@luchesigui luchesigui closed this Oct 20, 2018
@luchesigui
luchesigui deleted the fix/form-vazio branch October 20, 2018 19:20
@luchesigui
luchesigui restored the fix/form-vazio branch October 20, 2018 19:20
@luchesigui
luchesigui deleted the fix/form-vazio branch October 20, 2018 19:21
@luchesigui
luchesigui restored the fix/form-vazio branch October 20, 2018 19:21
@luchesigui luchesigui reopened this Oct 20, 2018
Comment thread src/App.js Outdated
@luchesigui

Copy link
Copy Markdown
Contributor Author

Externalizei a validação em uma função que aceita um array de campos a ser validados e os campos preenchidos

@victormiguez victormiguez left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread package.json
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-scripts": "2.0.5",
"styled-components": "^4.0.2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faltou uma virgulinha aqui.

Comment thread src/App.js
import InitiativeList from './components/InitiativeList';

const isFormFilled = (values, requiredFields) => !requiredFields
.map(field => values[field] ? true : false)

Copy link
Copy Markdown
Collaborator

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])?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants