Don't return default val for PK field in singleton (#6444)

Fixes #6429
This commit is contained in:
Rijk van Zanten
2021-06-22 18:19:02 -04:00
committed by GitHub
parent 3223c20baf
commit 25aaebacd4

View File

@@ -717,6 +717,11 @@ export class ItemsService<Item extends AnyItem = AnyItem> implements AbstractSer
}
for (const [name, field] of fields) {
if (this.schema.collections[this.collection].primary === name) {
defaults[name] = null;
continue;
}
defaults[name] = field.defaultValue;
}