This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Create a new endpoint for syllabus upload #13
Open
ssantichaivekin
wants to merge
21
commits into
hyperschedule:master
Choose a base branch
from
ssantichaivekin:syllabus-upload
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Create a new endpoint for syllabus upload #13
ssantichaivekin
wants to merge
21
commits into
hyperschedule:master
from
ssantichaivekin:syllabus-upload
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install firebase_admin and add the admin initialization to hyperschedule app.
Create upload syllabus endpoint that reads token from post request and get the user corresponding to the token from Firebase.
Install firebase_admin and add the admin initialization to hyperschedule app.
Create upload syllabus endpoint that reads token from post request and get the user corresponding to the token from Firebase.
Add input sanitization to syllabus upload endpoint. Clean up syllabus upload endpoint in general.
This solves the fetch API cannot load due to access control error.
Add OPTIONS to /upload-syllabus methods to fix access control problem
Update syllabus links at the start of the server by looking at metadata of all files in storage bucket. Update syllabus link of a course when its course syllabus is uploaded. Merge syllabus links with json data after scraping.
ssantichaivekin
commented
Apr 29, 2020
@@ -90,6 +92,33 @@ def view_api_v3(): | |||
raise APIError("data not available yet") | |||
return api_response({"data": diff, "until": until, "full": full}) | |||
|
|||
@app.route("/upload-syllabus", methods = ['PUT', 'POST', 'OPTIONS']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only include PUT
and OPTIONS
. Remove POST
from the list of methods.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Install Firebase Admin and create a new endpoint for syllabus upload. The firebase private json file which includes the private key is with me. It might be a good idea to move Firebase initialization, all authentication logic, and all syllabi logic to a new worker.