diff --git a/src/generic/model-store/slice.js b/src/generic/model-store/slice.js index 0bf587ff..1769f2ca 100644 --- a/src/generic/model-store/slice.js +++ b/src/generic/model-store/slice.js @@ -6,6 +6,9 @@ function add(state, modelType, model) { if (state[modelType] === undefined) { state[modelType] = {}; } + if (modelType.includes('IdToHashKeyMap')) { + state[modelType][model.hash_key] = id; + } state[modelType][id] = model; } @@ -13,6 +16,9 @@ function update(state, modelType, model) { if (state[modelType] === undefined) { state[modelType] = {}; } + if (modelType.includes('IdToHashKeyMap')) { + state[modelType][model.hash_key] = model.id; + } state[modelType][model.id] = { ...state[modelType][model.id], ...model }; }