[DSC-76] Delete pending json patch operations

This commit is contained in:
Alessandro Martelli
2021-05-28 13:19:59 +02:00
parent ddb7d5181f
commit da4be7b57f
8 changed files with 93 additions and 5 deletions

View File

@@ -11,7 +11,8 @@ import {
NewPatchReplaceOperationAction,
CommitPatchOperationsAction,
StartTransactionPatchOperationsAction,
RollbacktPatchOperationsAction
RollbacktPatchOperationsAction,
DeletePendingJsonPatchOperationsAction
} from './json-patch-operations.actions';
import { JsonPatchOperationModel, JsonPatchOperationType } from './json-patch.model';
@@ -101,6 +102,10 @@ export function jsonPatchOperationsReducer(state = initialState, action: PatchOp
return startTransactionPatchOperations(state, action as StartTransactionPatchOperationsAction);
}
case JsonPatchOperationsActionTypes.DELETE_PENDING_JSON_PATCH_OPERATIONS: {
return deletePendingOperations(state, action as DeletePendingJsonPatchOperationsAction);
}
default: {
return state;
}
@@ -178,6 +183,20 @@ function rollbackOperations(state: JsonPatchOperationsState, action: RollbacktPa
}
}
/**
* Set the JsonPatchOperationsState to its initial value.
*
* @param state
* the current state
* @param action
* an DeletePendingJsonPatchOperationsAction
* @return JsonPatchOperationsState
* the new state.
*/
function deletePendingOperations(state: JsonPatchOperationsState, action: DeletePendingJsonPatchOperationsAction): JsonPatchOperationsState {
return null;
}
/**
* Add new JSON patch operation list.
*