Skip to content

Commit 735970b

Browse files
Jake MaldonadoJake Maldonado
authored andcommitted
fix required field check not accepting 0 and false values
1 parent 09ddf4f commit 735970b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/classes/Entity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ class Entity<
11101110

11111111
// Check for required fields
11121112
Object.keys(required).forEach(field =>
1113-
required[field] !== undefined && !data[field]
1113+
required[field] !== undefined && data[field] !== null
11141114
&& error(`'${field}${this.schema.attributes[field].alias ? `/${this.schema.attributes[field].alias}` : ''}' is a required field`)
11151115
) // end required field check
11161116

0 commit comments

Comments
 (0)