Skip to content

Commit 28a6abd

Browse files
author
Rajeev Kumar Singh
committed
Choice Text Validation
1 parent 005100b commit 28a6abd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

polling-app-client/public/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
Learn how to configure a non-root public URL by running `npm run build`.
2121
-->
2222
<title>Polling App | CalliCoder</title>
23+
<meta name="description" content="Full Stack Polling App built with Spring Boot, Spring Security, JWT, MySQL, React and Ant Design.">
2324
</head>
2425
<body>
2526
<noscript>

polling-app-client/src/poll/NewPoll.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NewPoll extends Component {
3030
this.handleQuestionChange = this.handleQuestionChange.bind(this);
3131
this.handleChoiceChange = this.handleChoiceChange.bind(this);
3232
this.handlePollDaysChange = this.handlePollDaysChange.bind(this);
33-
this.handlePollHoursChange = this.hanldePollHoursChange.bind(this);
33+
this.handlePollHoursChange = this.handlePollHoursChange.bind(this);
3434
this.isFormInvalid = this.isFormInvalid.bind(this);
3535
}
3636

@@ -145,7 +145,7 @@ class NewPoll extends Component {
145145
});
146146
}
147147

148-
hanldePollHoursChange(value) {
148+
handlePollHoursChange(value) {
149149
const pollLength = Object.assign(this.state.pollLength, {hours: value});
150150
this.setState({
151151
pollLength: pollLength
@@ -157,11 +157,12 @@ class NewPoll extends Component {
157157
return true;
158158
}
159159

160-
this.state.choices.forEach(choice => {
160+
for(let i = 0; i < this.state.choices.length; i++) {
161+
const choice = this.state.choices[i];
161162
if(choice.validateStatus !== 'success') {
162163
return true;
163164
}
164-
});
165+
}
165166
}
166167

167168
render() {

0 commit comments

Comments
 (0)