Skip to content
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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

luchesigui
Copy link
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
src/App.js Outdated Show resolved Hide resolved
@luchesigui
Copy link
Contributor Author

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

Copy link
Collaborator

@victormiguez victormiguez left a 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"
Copy link
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.

@@ -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)
Copy link
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