更新了listnode的子结点上getFreshValue时,对父节点的create动作处理问题
This commit is contained in:
parent
61001d4e8e
commit
519827f1df
|
|
@ -1288,23 +1288,24 @@ var SingleNode = /** @class */ (function (_super) {
|
|||
var filter = this.getFilter();
|
||||
if (filter) {
|
||||
(0, assert_1.assert)(!disableOperation);
|
||||
if (this.operation) {
|
||||
operations.push({
|
||||
entity: this.entity,
|
||||
operation: this.operation.operation,
|
||||
});
|
||||
}
|
||||
// 如果是listNode下的一个子结点,则父结点上对应的operation也需要被redo
|
||||
var parent_1 = this.getParent();
|
||||
if (parent_1 instanceof ListNode) {
|
||||
var parentOperation = parent_1.getChildOperation(this);
|
||||
if (parentOperation) {
|
||||
// 现在只需要处理一种情况,就是在list上create,在这里update
|
||||
(0, assert_1.assert)(parentOperation.action === 'create');
|
||||
operations.push({
|
||||
entity: this.entity,
|
||||
operation: parentOperation,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.operation) {
|
||||
operations.push({
|
||||
entity: this.entity,
|
||||
operation: this.operation.operation,
|
||||
});
|
||||
}
|
||||
var result = this.cache.tryRedoOperationsThenSelect(this.entity, {
|
||||
data: projection,
|
||||
filter: filter,
|
||||
|
|
|
|||
|
|
@ -1304,23 +1304,26 @@ class SingleNode<ED extends EntityDict & BaseEntityDict,
|
|||
const filter = this.getFilter();
|
||||
if (filter) {
|
||||
assert(!disableOperation);
|
||||
if (this.operation) {
|
||||
operations.push({
|
||||
entity: this.entity,
|
||||
operation: this.operation.operation,
|
||||
});
|
||||
}
|
||||
// 如果是listNode下的一个子结点,则父结点上对应的operation也需要被redo
|
||||
const parent = this.getParent();
|
||||
if (parent instanceof ListNode) {
|
||||
const parentOperation = parent.getChildOperation(this);
|
||||
if (parentOperation) {
|
||||
// 现在只需要处理一种情况,就是在list上create,在这里update
|
||||
assert(parentOperation.action === 'create');
|
||||
operations.push({
|
||||
entity: this.entity,
|
||||
operation: parentOperation,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (this.operation) {
|
||||
operations.push({
|
||||
entity: this.entity,
|
||||
operation: this.operation.operation,
|
||||
});
|
||||
}
|
||||
|
||||
const result = this.cache.tryRedoOperationsThenSelect(this.entity, {
|
||||
data: projection,
|
||||
filter,
|
||||
|
|
|
|||
Loading…
Reference in New Issue