Fix(accounts): show challenge info on user profile
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
This commit is contained in:
12
common/utils/create-name-id-map.js
Normal file
12
common/utils/create-name-id-map.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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;
|
||||
}, {})
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user