fix: use default value for when specified new entity id

This commit is contained in:
Kyle Fang
2021-11-21 21:51:07 +08:00
parent 1c89611f54
commit 86bbecef8e

View File

@@ -150,7 +150,7 @@ export function EntityForm<M>({
*/
let baseDataSourceValues: Partial<EntityValues<M>>;
if ((status === "existing" || status === "copy") && entity) {
baseDataSourceValues = entity.values ?? {};
baseDataSourceValues = entity.values ?? initEntityValues(schema, path);
} else if (status === "new") {
baseDataSourceValues = initEntityValues(schema, path);
} else {