Skip to content

Commit

Permalink
feat: add new course for web3 (code100x#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsargam authored Oct 25, 2024
1 parent f13059f commit 0c553e9
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions src/utiles/appx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,50 +35,50 @@ function getExtraCourses(currentCourses: Course[], allCourses: Course[]) {

// We break down parent courses into child courses
// for eg, (web dev + devops) breaks down to web dev and devops
if (hasCohort3) {
const userCourses = [...initialCourses];

let hasWebDev = false;
let hasDevOps = false;
let hasWeb3 = false;
if (currentCourses.find((x) => x.id === 8)) {
hasWebDev = true;
hasDevOps = true;
hasWeb3 = true;
}
if (!hasCohort3) return initialCourses;

if (currentCourses.find((x) => x.id === 9)) {
hasWebDev = true;
hasDevOps = true;
}
const userCourses = [...initialCourses];

if (currentCourses.find((x) => x.id === 10)) {
hasWeb3 = true;
}
let hasWebDev = false;
let hasDevOps = false;
let hasWeb3 = false;
if (currentCourses.find((x) => x.id === 8)) {
hasWebDev = true;
hasDevOps = true;
hasWeb3 = true;
}

if (currentCourses.find((x) => x.id === 11)) {
hasWebDev = true;
}
if (currentCourses.find((x) => x.id === 9)) {
hasWebDev = true;
hasDevOps = true;
}

if (currentCourses.find((x) => x.id === 12)) {
hasDevOps = true;
}
if (currentCourses.find((x) => x.id === 10)) {
hasWeb3 = true;
}

if (hasWebDev) {
userCourses.push(allCourses.find((x) => x.id === 14)!);
}
if (currentCourses.find((x) => x.id === 11)) {
hasWebDev = true;
}

if (hasDevOps) {
userCourses.push(allCourses.find((x) => x.id === 15)!);
}
if (currentCourses.find((x) => x.id === 12)) {
hasDevOps = true;
}

if (hasWeb3) {
userCourses.push(allCourses.find((x) => x.id === 13)!);
}
if (hasWebDev) {
userCourses.push(allCourses.find((x) => x.id === 14)!);
}

if (hasDevOps) {
userCourses.push(allCourses.find((x) => x.id === 15)!);
}

return userCourses;
if (hasWeb3) {
userCourses.push(allCourses.find((x) => x.id === 13)!);
userCourses.push(allCourses.find((x) => x.id === 20)!);
}
return initialCourses;

return userCourses;
}

interface CoursesError {
Expand Down

0 comments on commit 0c553e9

Please sign in to comment.