Skip to content

Commit 6235e02

Browse files
committed
fix: add support for old 42 cursus in Common Core overview
1 parent 210d3ed commit 6235e02

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

src/handlers/core.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export const getCommonCoreCohortData = async function(prisma: PrismaClient, year
5757
project_users: {
5858
where: {
5959
project: {
60-
cursus_id: 21,
60+
id: {
61+
in: COMMON_CORE_PROJECTS_ORDER,
62+
},
6163
},
6264
},
6365
include: {

src/intra/projects.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,33 @@ export const DISCO_PISCINE_CORE_PYTHON_PROJECTS_ORDER = [2612, 2613, 2614, 2615,
1111
export const DISCO_PISCINE_WEB_PRGM_ESS_PROJECTS_ORDER = [2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034]; // Cursus ID 3
1212
export const DISCO_PISCINE_DEPR_PYTHON_PROJECTS_ORDER = []; // Not implemented, cursus ID 69
1313
export const COMMON_CORE_PROJECTS_ORDER = [
14+
540, // OLD_OLD_OLD_CORE Fillit
15+
2, // OLD_OLD_OLD_CORE GET_Next_line
16+
756, // OLD_OLD_OLD_CORE Piscine Reloaded
17+
1, // OLD_OLD_OLD_CORE Libft
18+
5, // OLD_OLD_OLD_CORE ft_printf
19+
687, // OLD_OLD_OLD_CORE init
20+
3, // OLD_OLD_OLD_CORE ft_ls
21+
4, // OLD_OLD_OLD_CORE FdF
22+
26, // OLD_OLD_OLD_CORE Filler
23+
27, // OLD_OLD_OLD_CORE Push_swap
24+
7, // OLD_OLD_OLD_CORE minishell
25+
33, // OLD_OLD_OLD_CORE ft_select
26+
15, // OLD_OLD_OLD_CORE Fract'ol
27+
1190, // OLD_OLD_OLD_CORE roger-skyline-1
28+
1117, // OLD_OLD_OLD_CORE GUImp
29+
29, // OLD_OLD_OLD_CORE Lem_in
30+
78, // OLD_OLD_OLD_CORE mod1
31+
847, // OLD_OLD_OLD_CORE docker-1
32+
8, // OLD_OLD_OLD_CORE Wolf3d
33+
23, // OLD_OLD_OLD_CORE RTv1
34+
523, // OLD_OLD_OLD_CORE 21sh
35+
122, // OLD_OLD_OLD_CORE Taskmaster
36+
1182, // OLD_OLD_OLD_CORE Doom Nukem
37+
24, // OLD_OLD_OLD_CORE RT
38+
35, // OLD_OLD_OLD_CORE 42sh
39+
22, // OLD_OLD_OLD_CORE Corewar
40+
403, // OLD_OLD_OLD_CORE Corewar Championship
1441
1314, // Libft
1542
1327, // Get_Next_Line
1643
1316, // ft_printf
@@ -75,9 +102,13 @@ export const COMMON_CORE_PROJECTS_ORDER = [
75102
1324, // OLD_CORE Exam Rank 06
76103
2623, // 42_Collaborative_resume
77104
1337, // ft_transcendence
105+
118, // OLD_OLD_OLD_CORE_CORE First Internship
78106
1638, // Work Experience I
79107
1662, // Startup Experience
80108
1650, // Part Time I
109+
597, // OLD_OLD_OLD_CORE_CORE Hypertube
110+
596, // OLD_OLD_OLD_CORE_CORE Matcha
111+
537, // OLD_OLD_OLD_CORE_CORE Camagru
81112
];
82113

83114
export const syncProjects = async function(api: Fast42, syncDate: Date): Promise<void> {

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export const getPiscineProjects = async function(prisma: PrismaClient, piscinePr
362362
};
363363

364364
export const getCommonCoreProjects = async function(prisma: PrismaClient, commonCoreProjectIdsOrdered: number[]): Promise<Project[]> {
365-
// Fetch all projects for cursus 21
365+
// Fetch all projects for the Common Core (cursus 21 or the old 42 cursus, filtered by the project ids defined in commonCoreProjectIdsOrdered)
366366
const projects = await prisma.project.findMany({
367367
where: {
368368
// cursus_id: 21,

0 commit comments

Comments
 (0)