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:
committed by
mrugesh mohapatra
parent
156ea1af76
commit
f916204ba5
@@ -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 = {};
|
||||
|
Reference in New Issue
Block a user