Add hash key and mapping model

This commit is contained in:
Kristin Aoki
2021-08-11 10:34:32 -04:00
parent a32a58019d
commit 0ba9ed7d31

View File

@@ -101,6 +101,7 @@ function mergeLearningSequencesWithCourseBlocks(learningSequencesModels, courseB
effortActivities: blocksSequence.effortActivities,
effortTime: blocksSequence.effortTime,
legacyWebUrl: blocksSequence.legacyWebUrl,
hash_key: blocksSequence.hash_key,
unitIds: blocksSequence.unitIds,
};
@@ -180,10 +181,18 @@ export function fetchCourse(courseId) {
modelType: 'sequences',
modelsMap: sequences,
}));
dispatch(addModelsMap({
modelType: 'sequenceIdToHashKeyMap',
modelsMap: sequences,
}));
dispatch(updateModelsMap({
modelType: 'units',
modelsMap: units,
}));
dispatch(addModelsMap({
modelType: 'unitIdToHashKeyMap',
modelsMap: units,
}));
}
const fetchedMetadata = courseMetadataResult.status === 'fulfilled';
@@ -235,10 +244,18 @@ export function fetchSequence(sequenceId) {
modelType: 'sequences',
model: sequence,
}));
dispatch(updateModel({
modelType: 'sequenceIdToHashKeyMap',
model: sequence,
}));
dispatch(updateModels({
modelType: 'units',
models: units,
}));
dispatch(updateModels({
modelType: 'unitIdToHashKeyMap',
models: units,
}));
dispatch(fetchSequenceSuccess({ sequenceId }));
}
} catch (error) {