Skip to content

Commit

Permalink
Update isEveryInFormNotEmpty.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
seelentov committed Jul 19, 2024
1 parent 8da9eab commit 056bbbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/utils/forms/isEveryInFormNotEmpty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export const isEveryInFormNotEmpty = (formData: {[key: string]: string}) => {
const result = Object.values(formData).every(input => (input && input?.length > 0) || true)
const result = Object.values(formData).every(input => {
const trimmedInput = input.trim()
return trimmedInput != "" && trimmedInput?.length > 0
})
console.log(result)
return result
}

0 comments on commit 056bbbd

Please sign in to comment.