Add id to hash key mapping for sequences and units

This commit is contained in:
Kristin Aoki
2021-08-11 10:33:54 -04:00
parent 367c8ad0df
commit a32a58019d

View File

@@ -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 };
}