Skip to content

Commit

Permalink
more constants
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcarvajal committed Feb 2, 2025
1 parent 8ac9630 commit 499a68d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/frontend/components/Plan/ReqErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ import { HelperToolTip } from "../Help";
import {
COOP_TITLE,
FALL_1,
FALL_1_COOP_ERROR_MSG,
GENERIC_ERROR_MSG,
SEARCH_NEU_FETCH_COURSE_ERROR_MSG,
SPRING_4,
SPRING_4_COOP_ERROR_MSG,
getCourseDisplayString,
} from "../../utils";
import { useFetchCourse } from "../../hooks";
Expand Down Expand Up @@ -52,11 +55,11 @@ export const ReqErrorModal: React.FC<ReqErrorModalProps> = ({
course.name === COOP_TITLE &&
term !== undefined &&
(term.id === FALL_1 || term.id === SPRING_4);
let msg = "This is an error.";
let msg = GENERIC_ERROR_MSG;
if (coopErr && term.id === FALL_1) {
msg = "You may only register a co-op in your second year and beyond.";
msg = FALL_1_COOP_ERROR_MSG;
} else if (coopErr && term.id === SPRING_4) {
msg = "You cannot register a co-op in your last semester.";
msg = SPRING_4_COOP_ERROR_MSG;
}
return (
<Flex
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export const GEN_PLACEHOLDER_MSG =
export const FALL_1 = "1-FL";
export const SPRING_4 = "4-SP";
export const COOP_TITLE = "Co-op Education";
export const FALL_1_COOP_ERROR_MSG =
"You may only register a co-op in your second year and beyond.";
export const SPRING_4_COOP_ERROR_MSG =
"You cannot register a co-op in your last semester.";
export const GENERIC_ERROR_MSG = "This is an error.";

export const defaultGuestStudent: GetStudentResponse = {
uuid: undefined,
Expand Down

0 comments on commit 499a68d

Please sign in to comment.