Skip to content

Commit 5f5632f

Browse files
committed
Revert "Fix validation logic in Stimulus comments controller"
This reverts commit 3303a74.
1 parent 408eded commit 5f5632f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/app/controllers/comments_controller.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ export default class extends Controller {
2222
errorList.innerHTML = '';
2323
if (!inputAuthor.value) {
2424
errors.push('Author');
25-
}
26-
if (!inputText.value) {
25+
} else if (!inputText.value) {
26+
errors.push('Text');
27+
} else {
28+
errors.push('Author');
2729
errors.push('Text');
2830
}
2931
errors.forEach((error) => {

0 commit comments

Comments
 (0)