mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
fix issue where the first relationship of a type wouldn't be added
This commit is contained in:
@@ -65,6 +65,14 @@ export class JsonPatchOperationsBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch a new NewPatchMoveOperationAction
|
||||
*
|
||||
* @param path
|
||||
* the new path tho move to
|
||||
* @param prevPath
|
||||
* the original path to move from
|
||||
*/
|
||||
move(path: JsonPatchOperationPathObject, prevPath: string) {
|
||||
this.store.dispatch(
|
||||
new NewPatchMoveOperationAction(
|
||||
|
@@ -294,6 +294,20 @@ function flushOperation(state: JsonPatchOperationsState, action: FlushPatchOpera
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new operation to a patch
|
||||
*
|
||||
* @param body
|
||||
* The current patch
|
||||
* @param actionType
|
||||
* The type of operation to add
|
||||
* @param targetPath
|
||||
* The path for the operation
|
||||
* @param value
|
||||
* The new value
|
||||
* @param fromPath
|
||||
* The previous path (in case of a move operation)
|
||||
*/
|
||||
function addOperationToList(body: JsonPatchOperationObject[], actionType, targetPath, value?, fromPath?) {
|
||||
const newBody = Array.from(body);
|
||||
switch (actionType) {
|
||||
|
Reference in New Issue
Block a user