Skip to content

Commit

Permalink
fix: cleanup errors and warnings (#412)
Browse files Browse the repository at this point in the history
* fix: cleanup errors and warnings

* fix: no-goals on iep.tsx + using activeIp instead of checking for null dates
  • Loading branch information
thomhickey authored Sep 17, 2024
1 parent 197228b commit 3e31369
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/iep/Iep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const Iep = ({ iep_id }: IepProps) => {
src={noGoals}
alt="no goals image"
className={$Image.fitContent}
priority={true}
/>
<p className={$Iep.noGoalText}>No goals yet</p>
<p className={$Iep.noGoalTextSmall}>
Expand Down
19 changes: 13 additions & 6 deletions src/pages/students/[student_id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ const ViewStudentPage = () => {
grade: Number(data.get("grade")) || 0,
});

editIepMutation.mutate({
student_id: student.student_id,
start_date: new Date(parseISO(data.get("start_date") as string)),
end_date: new Date(parseISO(data.get("end_date") as string)),
});
if (activeIep) {
editIepMutation.mutate({
student_id: student.student_id,
start_date: new Date(parseISO(data.get("start_date") as string)),
end_date: new Date(parseISO(data.get("end_date") as string)),
});
}

handleMainState();
};
Expand Down Expand Up @@ -163,7 +165,11 @@ const ViewStudentPage = () => {
<p id="modal-modal-title" className={$CompassModal.editModalHeader}>
Editing {student?.first_name || "Student"}&apos;s Profile
</p>
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
<Typography
id="modal-modal-description"
sx={{ mt: 2 }}
component="div"
>
<Stack gap={0.5} sx={{ width: "100%" }}>
<form
className={$CompassModal.editForm}
Expand Down Expand Up @@ -319,6 +325,7 @@ const ViewStudentPage = () => {
src={noGoals}
alt="no IEP image"
className={$Image.fitContent}
priority={true}
/>
<p className={$StudentPage.textSpacing}>
This student does not have an active IEP. Please create one.
Expand Down

0 comments on commit 3e31369

Please sign in to comment.