Skip to content

Commit

Permalink
fix: CANCELED로 프로퍼티 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hamo-o committed Nov 4, 2024
1 parent 839f51d commit 5d08579
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const AssignmentButtons = ({
);
}

if (assignmentStatus === "CANCELLED") {
if (assignmentStatus === "CANCELED") {
return (
<Flex gap="sm">
<Button size="sm" style={{ pointerEvents: "none" }} variant="sub">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CurriculumListItem = ({
/>
<Flex direction="column" minWidth={52}>
<Text typo="body1">{week}주차</Text>
{curriculumStatus === "CANCELLED" && (
{curriculumStatus === "CANCELED" && (
<Text color="sub" typo="body2">
휴강 주차
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AssignmentHeader = ({ assignment, disabled }: AssignmentHeaderProps) => {
const onOpen = methods.getValues("onOpen");

const handleClickSubmit = async () => {
if (assignmentStatus === "CANCELLED") return;
if (assignmentStatus === "CANCELED") return;

const data = {
title: methods.getValues("title"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Assignments = ({
const { assignmentStatus, week, studyTitle } = assignment;

// TODO: 휴강된 경우 진입 막기
if (assignmentStatus === "CANCELLED") return null;
if (assignmentStatus === "CANCELED") return null;

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ const StudyInfoStatus = ({ index }: { index: number }) => {
const { control, setValue, watch } = useFormContext();
const [checked, setChecked] = useState(false);
useEffect(() => {
setValue(
`studyCurriculums.${index}.status`,
checked ? "CANCELLED" : "OPEN"
);
setValue(`studyCurriculums.${index}.status`, checked ? "CANCELED" : "OPEN");
}, [checked]);

return (
Expand All @@ -25,7 +22,7 @@ const StudyInfoStatus = ({ index }: { index: number }) => {
name={`studyCurriculums.${index}.status`}
render={() => (
<Checkbox
checked={watch(`studyCurriculums.${index}.status`) === "CANCELLED"}
checked={watch(`studyCurriculums.${index}.status`) === "CANCELED"}
defaultChecked={false}
onChange={() => setChecked(!checked)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const usePrefillStudyDetailInfo = (studyId: number) => {
description: data.description || "",
difficulty: data.difficulty || undefined,
status:
data.curriculumStatus === "CANCELLED" ? "CANCELLED" : "OPEN",
data.curriculumStatus === "CANCELED" ? "CANCELED" : "OPEN",
})) || [],
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/constants/status/assignmentStatusMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const assignmentStatusMap: Record<
> = {
NONE: "개설",
OPEN: "수정",
CANCELLED: "개설",
CANCELED: "개설",
};

export const assignmentSubmissionStatusMap: Record<
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/types/entities/assignment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type AssignmentStatusType = "NONE" | "OPEN" | "CANCELLED";
export type AssignmentStatusType = "NONE" | "OPEN" | "CANCELED";
export type AssignmentSubmissionStatusType =
| "NOT_SUBMITTED"
| "FAILURE"
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/types/entities/study.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type StudyDifficultyArrayType = {
value: StudyDifficultyType;
}[];

export type StudyAssignmentStatusType = "NONE" | "OPEN" | "CANCELLED";
export type StudyAssignmentStatusType = "NONE" | "OPEN" | "CANCELED";

export type StudyDifficultyType = "HIGH" | "MEDIUM" | "LOW" | "BASIC";

Expand Down
2 changes: 1 addition & 1 deletion apps/admin/utils/validate/studyDetailInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const StudyCurriculumTypeSchema = z.object({
title: z.string().optional().nullable(),
description: z.string().optional().nullable(),
difficulty: z.enum(["HIGH", "MEDIUM", "LOW", "BASIC"]).optional().nullable(),
status: z.enum(["OPEN", "CANCELLED", "NONE"]).optional().nullable(),
status: z.enum(["OPEN", "CANCELED", "NONE"]).optional().nullable(),
});

export const studyDetailInfoSchema = z.object({
Expand Down

0 comments on commit 5d08579

Please sign in to comment.