mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
Cache redesign part 1, and add support for alternative links
This commit is contained in:
@@ -20,7 +20,7 @@ import { JsonPatchOperationModel, JsonPatchOperationType } from './json-patch.mo
|
||||
*/
|
||||
export interface JsonPatchOperationObject {
|
||||
operation: JsonPatchOperationModel;
|
||||
timeAdded: number;
|
||||
timeCompleted: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +264,7 @@ function flushOperation(state: JsonPatchOperationsState, action: FlushPatchOpera
|
||||
newChildren = Object.assign({}, state[ action.payload.resourceType ].children, {
|
||||
[action.payload.resourceId]: {
|
||||
body: state[ action.payload.resourceType ].children[ action.payload.resourceId ].body
|
||||
.filter((entry) => entry.timeAdded > state[ action.payload.resourceType ].transactionStartTime)
|
||||
.filter((entry) => entry.timeCompleted > state[ action.payload.resourceType ].transactionStartTime)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -278,7 +278,7 @@ function flushOperation(state: JsonPatchOperationsState, action: FlushPatchOpera
|
||||
newChildren = Object.assign({}, newChildren, {
|
||||
[resourceId]: {
|
||||
body: newChildren[ resourceId ].body
|
||||
.filter((entry) => entry.timeAdded > state[ action.payload.resourceType ].transactionStartTime)
|
||||
.filter((entry) => entry.timeCompleted > state[ action.payload.resourceType ].transactionStartTime)
|
||||
}
|
||||
});
|
||||
})
|
||||
@@ -336,5 +336,5 @@ function addOperationToList(body: JsonPatchOperationObject[], actionType, target
|
||||
}
|
||||
|
||||
function makeOperationEntry(operation) {
|
||||
return { operation: operation, timeAdded: new Date().getTime() };
|
||||
return { operation: operation, timeCompleted: new Date().getTime() };
|
||||
}
|
||||
|
Reference in New Issue
Block a user