feat(api): add multifile python projects to new api (#53931)

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
Tom
2024-03-11 09:58:09 -05:00
committed by GitHub
parent 242290a1a0
commit 2183ae4d89
3 changed files with 20 additions and 7 deletions

View File

@@ -16,6 +16,10 @@ export const multifileCertProjectIds = getChallenges()
.filter(c => c.challengeType === challengeTypes.multifileCertProject)
.map(c => c.id);
export const multifilePythonCertProjectIds = getChallenges()
.filter(c => c.challengeType === challengeTypes.multifilePythonCertProject)
.map(c => c.id);
export const msTrophyChallenges = getChallenges()
.filter(challenge => challenge.challengeType === challengeTypes.msTrophy)
.map(({ id, msTrophyId }) => ({ id, msTrophyId }));
@@ -124,7 +128,8 @@ export async function updateUserChallengeData(
if (
jsCertProjectIds.includes(challengeId) ||
multifileCertProjectIds.includes(challengeId)
multifileCertProjectIds.includes(challengeId) ||
multifilePythonCertProjectIds.includes(challengeId)
) {
completedChallenge = {
..._completedChallenge,
@@ -186,7 +191,10 @@ export async function updateUserChallengeData(
userCompletedChallenges.push(finalChallenge);
}
if (multifileCertProjectIds.includes(challengeId)) {
if (
multifileCertProjectIds.includes(challengeId) ||
multifilePythonCertProjectIds.includes(challengeId)
) {
const challengeToSave: SavedChallenge = {
id: challengeId,
lastSavedDate: newProgressTimeStamp,