|
|
@ -120,16 +120,11 @@ export const collections = handleActions(
|
|
|
|
export const items = handleActions(
|
|
|
|
export const items = handleActions(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[combineActions(
|
|
|
|
[combineActions(
|
|
|
|
actions.setCacheItem,
|
|
|
|
actions.setCacheItem
|
|
|
|
actions.unsetCacheItem
|
|
|
|
|
|
|
|
).toString()]: (state: CacheItemsData, action: ActionMeta<CacheItem, { colUid: string, itemUid: string, deleted: boolean }>) => {
|
|
|
|
).toString()]: (state: CacheItemsData, action: ActionMeta<CacheItem, { colUid: string, itemUid: string, deleted: boolean }>) => {
|
|
|
|
if (action.payload !== undefined) {
|
|
|
|
if (action.payload !== undefined) {
|
|
|
|
if (action.meta.deleted) {
|
|
|
|
|
|
|
|
return state.removeIn([action.meta.colUid, action.meta.itemUid]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return state.setIn([action.meta.colUid, action.meta.itemUid], action.payload);
|
|
|
|
return state.setIn([action.meta.colUid, action.meta.itemUid], action.payload);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
return state;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[combineActions(
|
|
|
|
[combineActions(
|
|
|
@ -142,11 +137,7 @@ export const items = handleActions(
|
|
|
|
return state.withMutations((state) => {
|
|
|
|
return state.withMutations((state) => {
|
|
|
|
let i = 0;
|
|
|
|
let i = 0;
|
|
|
|
for (const item of action.meta.items) {
|
|
|
|
for (const item of action.meta.items) {
|
|
|
|
if (item.isDeleted) {
|
|
|
|
|
|
|
|
state.removeIn([action.meta.colUid, item.uid]);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
state.setIn([action.meta.colUid, item.uid], action.payload[i]);
|
|
|
|
state.setIn([action.meta.colUid, item.uid], action.payload[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|