Add id to hash key mapping for sequences and units
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user