Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new course for web3 #1511

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading