This changes the behavior of the user profile page to pull the current challenge info from our challenge map and overwrite the user challenge. This should also make name changes point to the correct challenge regardless of the info saved to the user profile
13 lines
367 B
JavaScript
13 lines
367 B
JavaScript
// createNameIdMap(entities: Object) => Object
|
|
export default function createNameIdMap(entities) {
|
|
const { challenge } = entities;
|
|
return {
|
|
...entities,
|
|
challengeIdToName: Object.keys(challenge)
|
|
.reduce((map, challengeName) => {
|
|
map[challenge[challengeName].id] = challenge[challengeName].dashedName;
|
|
return map;
|
|
}, {})
|
|
};
|
|
}
|