Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JHawk0224 committed Apr 10, 2024
1 parent 9b1f79e commit bff1828
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/degree-plan/components/Dock/Dock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ interface DockProps {
const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => {
// const [courseAdded, setCourseAdded] = React.useState(false);
const { searchPanelOpen, setSearchPanelOpen, setSearchRuleQuery, setSearchRuleId } = useContext(SearchPanelContext)
const { createOrUpdate } = useSWRCrud<DockedCourse>(`/api/degree/docked`, { idKey: 'full_code' });
const { createOrUpdate, remove } = useSWRCrud<DockedCourse>(`/api/degree/docked`, { idKey: 'full_code' });
const {data: dockedCourses = [], isLoading} = useSWR<DockedCourse[]>(user ? `/api/degree/docked` : null);

// Returns a boolean that indiates whether this is the first render
Expand Down Expand Up @@ -152,7 +152,6 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => {
// }
// }, [isMount, dockedCourses]);

const { remove } = useSWRCrud<DockedCourse>(`/api/degree/docked`, { idKey: 'full_code' });
const handleRemoveCourse = (full_code: string) => {
remove(full_code);
}
Expand Down Expand Up @@ -202,7 +201,7 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => {
)}
<CloseIcon>
<CourseXButton onClick={(e) => {
temps.forEach((course) => handleRemoveCourse(course.full_code));
dockedCourses.forEach((course) => handleRemoveCourse(course.full_code));
e.stopPropagation();
}} hidden={false}/>
</CloseIcon>
Expand Down

0 comments on commit bff1828

Please sign in to comment.