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

Update sgyfetch function on firebase functions #115

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

ImNotRog
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Aug 11, 2022

Visit the preview URL for this PR (updated for commit af50813):

https://gunnwatt--pr115-updatefetch-ow9rs837.web.app

(expires Thu, 18 Aug 2022 14:20:37 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@@ -182,7 +187,7 @@ export const fetchMaterials = functions.https.onCall(async (data, context) => {
const pages = responses[4 * i + 2].page;
const events = responses[4 * i + 3].event;

sections[course.section_title.split(' ')[0][0]] = {
sections[course.section_title.split(' ')[0][0] as SgyPeriod] = {
Copy link
Member

Choose a reason for hiding this comment

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

Does

sections[course.section_title.split(' ')[0][0]]

work for study hall? I'm not sure what course.section_title looks like, but taking the first letter of the first word wouldn't work if the title were "Study Hall".

const title = sec.section_title.toLowerCase();
return (title.endsWith(YEAR_STR) && title !== YEAR_STR);
})
const grad_year = ['se', 'ju', 'so', 'fr'].indexOf(gunn_student_course.section_title.slice(0,2)) + CURRENT_YEAR + 1;
const grad_year = ['se', 'ju', 'so', 'fr'].indexOf(gunnStudentCourse.section_title.slice(0,2)) + CURRENT_YEAR + 1;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a better way to get graduation year via the schoology API? I recall when digging into obscure properties in people's userData objects on firestore that some people had a gradYear lumped into their schoology data. Is there a way we could fetch this instead of the gunn student course?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but it would require a separate fetch to /users/me, and iirc the gradYear is also off by one year for no reason at all. Might just be better to just parse courses instead.

@ky28059 ky28059 added functions To do with the backend client To do with the frontend classes Relates to the classes tab in WATT. labels Aug 11, 2022
@ky28059 ky28059 linked an issue Aug 11, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
classes Relates to the classes tab in WATT. client To do with the frontend functions To do with the backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add study hall integration
2 participants