fixed patch move

This commit is contained in:
lotte
2019-12-13 16:58:59 +01:00
parent b7f18a1275
commit e3355455af
6 changed files with 63 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import { Store } from '@ngrx/store';
import { CoreState } from '../../core.reducers';
import {
NewPatchAddOperationAction,
NewPatchAddOperationAction, NewPatchMoveOperationAction,
NewPatchRemoveOperationAction,
NewPatchReplaceOperationAction
} from '../json-patch-operations.actions';
@@ -61,6 +61,18 @@ export class JsonPatchOperationsBuilder {
this.prepareValue(value, plain, false)));
}
move(path: JsonPatchOperationPathObject, prevPath: string) {
this.store.dispatch(
new NewPatchMoveOperationAction(
path.rootElement,
path.subRootElement,
prevPath,
path.path
)
);
}
/**
* Dispatches a new NewPatchRemoveOperationAction
*