fix(cert-settings): Uncouple Cert-Settings from dashedName's
This commit is contained in:
		| @@ -1,19 +1,14 @@ | ||||
| import { dasherize } from '../../../../../server/utils/index'; | ||||
|  | ||||
| export const jsProjectSuperBlock = 'javascript-algorithms-and-data-structures'; | ||||
|  | ||||
| export function buildUserProjectsMap(projectBlock, challengeMap) { | ||||
|   const { | ||||
|     challengeNameIdMap, | ||||
|     challenges, | ||||
|     superBlock | ||||
|   } = projectBlock; | ||||
|   return { | ||||
|     [superBlock]: challenges.reduce((solutions, current) => { | ||||
|       const dashedName = dasherize(current) | ||||
|         .replace('java-script', 'javascript') | ||||
|         .replace('metric-imperial', 'metricimperial'); | ||||
|       const completed = challengeMap[challengeNameIdMap[dashedName]]; | ||||
|       const { id } = current; | ||||
|       const completed = challengeMap[id]; | ||||
|       let solution = ''; | ||||
|       if (superBlock === jsProjectSuperBlock) { | ||||
|         solution = {}; | ||||
| @@ -25,7 +20,7 @@ export function buildUserProjectsMap(projectBlock, challengeMap) { | ||||
|       } | ||||
|       return { | ||||
|         ...solutions, | ||||
|         [current]: solution | ||||
|         [current.title]: solution | ||||
|       }; | ||||
|     }, {}) | ||||
|   }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user