diff --git a/packages/api/migrations/1734207079520-add-minor-to-plan.ts b/packages/api/migrations/1734207079520-add-minor-to-plan.ts new file mode 100644 index 000000000..864cb63c4 --- /dev/null +++ b/packages/api/migrations/1734207079520-add-minor-to-plan.ts @@ -0,0 +1,17 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class addMinorToPlan1734207079520 implements MigrationInterface { + name = "addMinorToPlan1734207079520"; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "plan" RENAME COLUMN "notes" TO "minor"` + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "plan" RENAME COLUMN "minor" TO "notes"` + ); + } +} diff --git a/packages/api/src/plan/entities/plan.entity.ts b/packages/api/src/plan/entities/plan.entity.ts index 6622393a5..0bb168057 100644 --- a/packages/api/src/plan/entities/plan.entity.ts +++ b/packages/api/src/plan/entities/plan.entity.ts @@ -28,6 +28,9 @@ export class Plan { @Column({ nullable: true }) major: string; + @Column({ nullable: true }) + minor: string; + @Column({ nullable: true }) concentration: string; diff --git a/packages/frontend/hooks/useMinor.ts b/packages/frontend/hooks/useMinor.ts index c00e5e808..dfb27f2fb 100644 --- a/packages/frontend/hooks/useMinor.ts +++ b/packages/frontend/hooks/useMinor.ts @@ -20,6 +20,8 @@ type MinorReturn = MinorResponse & { * @param minorName The name of the major, ex: "Computer Science, BSCS". */ export function useMinor(catalogYear: number, minorName: string): MinorReturn { + console.log("useMinor called with: ", catalogYear, minorName); + // debugger; const key = `api/minor/${catalogYear}/${minorName}`; const { data, ...rest } = useSWR( diff --git a/packages/frontend/pages/home.tsx b/packages/frontend/pages/home.tsx index ea814b256..258dbcad4 100644 --- a/packages/frontend/pages/home.tsx +++ b/packages/frontend/pages/home.tsx @@ -243,6 +243,8 @@ const HomePage: NextPage = () => { let renderedSidebar = ; if (selectedPlan) { if (selectedPlan.major) { + console.log("PRINTING SELECTED PLAN"); + console.log(selectedPlan); renderedSidebar = (