mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
implemented applying of a patch
This commit is contained in:
4
src/app/core/cache/object-cache.reducer.ts
vendored
4
src/app/core/cache/object-cache.reducer.ts
vendored
@@ -112,13 +112,15 @@ export function objectCacheReducer(state = initialState, action: ObjectCacheActi
|
||||
* the new state, with the object added, or overwritten.
|
||||
*/
|
||||
function addToObjectCache(state: ObjectCacheState, action: AddToObjectCacheAction): ObjectCacheState {
|
||||
const existing = state[action.payload.objectToCache.self];
|
||||
return Object.assign({}, state, {
|
||||
[action.payload.objectToCache.self]: {
|
||||
data: action.payload.objectToCache,
|
||||
timeAdded: action.payload.timeAdded,
|
||||
msToLive: action.payload.msToLive,
|
||||
requestHref: action.payload.requestHref,
|
||||
isDirty: false
|
||||
isDirty: false,
|
||||
patches: (hasValue(existing) ? existing.patches : [])
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user