fix: make challenge links on profile page work (#36701)

* fix: make challenge links on profile page work

* fix: filter out certs from displaying

* fix: add suggested changes
This commit is contained in:
Tom
2019-08-29 12:55:06 -05:00
committed by mrugesh
parent a59b8636cb
commit 70b7080833
2 changed files with 20 additions and 12 deletions

View File

@ -1,5 +1,6 @@
import { Observable } from 'rx';
import { isEmpty } from 'lodash';
import { dasherize } from '../utils';
export default function(Challenge) {
let challengeIdToNameMap;
@ -20,8 +21,11 @@ export default function(Challenge) {
throw Error(err);
}
challengeIdToNameMap = challenges.reduce((map, challenge) => {
const { id, title } = challenge;
map[id] = title;
const { id, block, dashedName, title, superBlock } = challenge;
map[id] = {
challengeTitle: title,
challengePath: `${superBlock}/${dasherize(block)}/${dashedName}`
};
return map;
}, {});
});