Skip to content

Commit 86578d9

Browse files
Merge pull request #67 from EOS-uiux-Solutions/bug/new-story-form
fixed form validation bug for description
2 parents 3676b93 + ef4c2da commit 86578d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pages/NewStory.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ const NewStory = () => {
105105
setCurrentProductSelected(selectedProduct?.id ?? 'None')
106106
}
107107

108-
const onSubmit = async (data) => {
108+
const descError = () => {
109109
if (!description?.length) {
110110
setDescriptionError(true)
111-
return
112111
}
112+
}
113+
114+
const onSubmit = async (data) => {
113115
data.Description = filterDescriptionText(description)
114116
const formData = new FormData()
115117
formData.append('data', JSON.stringify(data))
@@ -249,6 +251,7 @@ const NewStory = () => {
249251
type='submit'
250252
data-cy='btn-submit'
251253
className='btn btn-default'
254+
onClick={descError}
252255
>
253256
Submit
254257
</Button>

0 commit comments

Comments
 (0)