Skip to content

Commit 10f3a06

Browse files
committed
fix(collections): default values
1 parent 6f98ef3 commit 10f3a06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export function generateCollectionInsert(collection: ResolvedCollection, data: P
138138
const property = describeProperty(collection.extendedSchema, key)
139139
// const value = (collection.extendedSchema).shape[key]
140140

141-
const defaultValue = property?.default ? property.default : 'NULL'
141+
const defaultValue = 'default' in property ? property.default : 'NULL'
142142

143143
const valueToInsert = (typeof data[key] === 'undefined' || String(data[key]) === 'null')
144144
? defaultValue

0 commit comments

Comments
 (0)