当update/remove不更新实际数据时,直接返回
This commit is contained in:
parent
8adec9d3c1
commit
942a10f370
|
|
@ -1230,7 +1230,7 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
};
|
||||
const closeRootMode = context.openRootMode();
|
||||
await this.cascadeUpdateAsync('oper', createOper, context, {
|
||||
dontCollect: true,
|
||||
dontCollect: !option.logId, // 如果是在创建log,则把oper收集回去
|
||||
});
|
||||
closeRootMode();
|
||||
}
|
||||
|
|
@ -1274,6 +1274,10 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
});
|
||||
});
|
||||
}
|
||||
if (ids.length === 0) {
|
||||
// 如果没有行需要更新/删除,直接返回
|
||||
return {};
|
||||
}
|
||||
if (data) {
|
||||
this.preProcessDataUpdated(action, data, true);
|
||||
}
|
||||
|
|
@ -1403,7 +1407,7 @@ class CascadeStore extends RowStore_1.RowStore {
|
|||
};
|
||||
const closeRootMode = context.openRootMode();
|
||||
await this.cascadeUpdateAsync('oper', createOper, context, {
|
||||
dontCollect: true,
|
||||
dontCollect: !option.logId, // 如果是在创建log,则把oper收集回去
|
||||
});
|
||||
closeRootMode();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ exports.logTriggers = [
|
|||
iState: 'rollbacked',
|
||||
},
|
||||
}, {});
|
||||
return (result.oper.remove || 0) + (result2.log.remove || 0);
|
||||
return (result.oper?.remove || 0) + (result2.log?.remove || 0);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,7 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
|
|||
};
|
||||
const closeRootMode = context.openRootMode();
|
||||
await this.cascadeUpdateAsync('oper', createOper, context, {
|
||||
dontCollect: true,
|
||||
dontCollect: !option.logId, // 如果是在创建log,则把oper收集回去
|
||||
});
|
||||
closeRootMode();
|
||||
}
|
||||
|
|
@ -1554,6 +1554,10 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
|
|||
}
|
||||
);
|
||||
}
|
||||
if (ids.length === 0) {
|
||||
// 如果没有行需要更新/删除,直接返回
|
||||
return {};
|
||||
}
|
||||
if (data) {
|
||||
this.preProcessDataUpdated(action, data, true);
|
||||
}
|
||||
|
|
@ -1692,7 +1696,7 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
|
|||
}
|
||||
const closeRootMode = context.openRootMode();
|
||||
await this.cascadeUpdateAsync('oper', createOper, context, {
|
||||
dontCollect: true,
|
||||
dontCollect: !option.logId, // 如果是在创建log,则把oper收集回去
|
||||
});
|
||||
closeRootMode();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ export const logTriggers: Trigger<EntityDict & BaseEntityDict, 'log', AsyncConte
|
|||
},
|
||||
}, {});
|
||||
|
||||
return (result.oper!.remove || 0) + (result2.log!.remove || 0);
|
||||
return (result.oper?.remove || 0) + (result2.log?.remove || 0);
|
||||
}
|
||||
} as CreateTriggerInTxn<EntityDict & BaseEntityDict, 'log', AsyncContext<EntityDict & BaseEntityDict>>
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue