create时容了没有entity子树的错

This commit is contained in:
Xu Chang 2022-03-31 18:35:49 +08:00
parent 4c7c6c7635
commit 4ec6fa550c
2 changed files with 2 additions and 2 deletions

View File

@ -622,7 +622,7 @@ class TreeStore extends CascadeStore_1.CascadeStore {
switch (action) {
case 'create': {
const { id } = data;
const node = (this.store[entity])[id];
const node = this.store[entity] && (this.store[entity])[id];
const row = node && this.constructRow(node, context) || {};
/* if (row) {
throw new OakError(RowStore.$$LEVEL, RowStore.$$CODES.primaryKeyConfilict);

View File

@ -771,7 +771,7 @@ export default class TreeStore<ED extends {
switch (action) {
case 'create': {
const { id } = data as DeduceCreateOperationData<ED[T]["Schema"]>;
const node = (this.store[entity]!)[id as string];
const node = this.store[entity] && (this.store[entity]!)[id as string];
const row = node && this.constructRow(node, context) || {};
/* if (row) {
throw new OakError(RowStore.$$LEVEL, RowStore.$$CODES.primaryKeyConfilict);