Skip to content

Commit b2d8f45

Browse files
committed
fix: change getFirstSemCourses from promise to async function
Gary recommended this change. A lot more condensed. Signed-off-by: Lucas Sta Maria <[email protected]>
1 parent 11fa2e9 commit b2d8f45

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/js/saspowerschoolff.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,8 @@ function showFirstSemGPA () {
290290
* Get the first semester courses and grades HTML.
291291
* @returns {Promise} the html from the first semester course and grades page
292292
*/
293-
function getFirstSemCourses () {
294-
return new Promise((resolve, reject) => {
295-
fetch("https://powerschool.sas.edu.sg/guardian/termgrades.html")
296-
.then(response => {
297-
resolve(response);
298-
});
299-
});
293+
async function getFirstSemCourses () {
294+
return await (await fetch("https://powerschool.sas.edu.sg/guardian/termgrades.html")).text();
300295
}
301296

302297
/**

0 commit comments

Comments
 (0)