Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefetching section information #2

Open
ninest opened this issue Jul 23, 2022 · 0 comments
Open

Prefetching section information #2

ninest opened this issue Jul 23, 2022 · 0 comments

Comments

@ninest
Copy link
Owner

ninest commented Jul 23, 2022

Currently, I am only fetching overall course info (number, title, description, lecture type), and a list of sections (term code and CRN)

export interface Course {
  // No term for courses. Terms are only required for sections
  subject: string;
  number: string;
  scheduleType: string;
  title: string;
  credits: number;
  nuPath: NUPath[];
  description?: string;

  sections: {
    term: string;
    crn: string;
  }[];
}

Should professor information also be added to the list of sections?

Yes because

  • it will allow to search for courses by professor (search is currently slow, but that's another issue)
  • The course page will load faster: no need to make an API call to view a list of professors teaching that course

No because

  • search is already slow and adding another field to search through will make it even slower (maybe make a search API for this?)
  • sections can be added/change during the semester, so the data will become outdated

Leaning towards yes if

  • search can be improved
  • use getStaticProps to get possible stale data, then update it with React Query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant