Skip to content

Commit

Permalink
Allow course.offered to be null
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Dec 14, 2022
1 parent c505d8d commit d32a499
Show file tree
Hide file tree
Showing 4 changed files with 482 additions and 228 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
NEXT_PUBLIC_API_ENDPOINT=https://api.michigantechcourses.com
NEXT_PUBLIC_THUMOR_ENDPOINT=https://thumbor.michigantechcourses.com
NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=

# Set by CI/CD
Expand Down
2 changes: 1 addition & 1 deletion src/components/courses-table/details-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const DetailsRow = ({course, onlyShowSections, onShowEverything, onShareCourse}:
</Text>

{
course.course.offered.length > 0 && (
course.course.offered && course.course.offered.length > 0 && (
<Text whiteSpace="normal">
<b>Semesters offered: </b>
{toTitleCase(course.course.offered.join(', '))}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface ICourseFromAPI {
prereqs: string | null;
updatedAt: string;
deletedAt: string | null;
offered: string[];
offered: string[] | null;
minCredits: number;
maxCredits: number;
}
Expand Down
Loading

1 comment on commit d32a499

@vercel
Copy link

@vercel vercel bot commented on d32a499 Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.