Chore: Update User model (#17171)

* fix(logs): Remove console.log's

* chore(challengeMap): challengeMap -> completedChallenges

* chore(userModel): Update user model

* feat(userIDs): Add user ident fields

* chore(github): Remove more refs to github data
This commit is contained in:
Stuart Taylor
2018-05-15 14:56:26 +01:00
committed by mrugesh mohapatra
parent 156ea1af76
commit f916204ba5
23 changed files with 233 additions and 742 deletions

View File

@@ -1,6 +1,8 @@
import { find } from 'lodash';
export const jsProjectSuperBlock = 'javascript-algorithms-and-data-structures';
export function buildUserProjectsMap(projectBlock, challengeMap) {
export function buildUserProjectsMap(projectBlock, completedChallenges) {
const {
challenges,
superBlock
@@ -8,7 +10,10 @@ export function buildUserProjectsMap(projectBlock, challengeMap) {
return {
[superBlock]: challenges.reduce((solutions, current) => {
const { id } = current;
const completed = challengeMap[id];
const completed = find(
completedChallenges,
({ id: completedId }) => completedId === id
);
let solution = '';
if (superBlock === jsProjectSuperBlock) {
solution = {};