do not allow to skip required field with whitespace

This commit is contained in:
Pete Matsyburka
2024-04-22 21:15:57 +03:00
parent ab57076b8f
commit 02a7b6ea55
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -471,10 +471,14 @@ import i18n from './i18n'
const isEmpty = (obj) => {
if (obj == null) return true
if (Array.isArray(obj) || typeof obj === 'string') {
if (Array.isArray(obj)) {
return obj.length === 0
}
if (typeof obj === 'string') {
return obj.trim().length === 0
}
if (typeof obj === 'object') {
return Object.keys(obj).length === 0
}