Skip to content

Commit

Permalink
implemented GET /timetable
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiskas101 committed Feb 12, 2025
1 parent 2ffc9fa commit a3f5511
Show file tree
Hide file tree
Showing 5 changed files with 892 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def download_resource():


@app.route('/attendance', methods=['GET'])
@limiter.limit("1000 per minute")
@limiter.limit("15 per minute")
def fetch_attendance_summary():

cookies = session.get('session_cookie')
Expand All @@ -166,6 +166,20 @@ def fetch_attendance_summary():
return response


@app.route('/timetable', methods=['GET'])
@limiter.limit("15 per minute")
def fetch_timetable():

cookies = session.get('session_cookie')
if cookies == None:
return Response(status=401)

response = core_utils.get_timetable(cookies=cookies)
# print(response)
if response == None:
return Response(status=404)

return response


if __name__ == "__main__":
Expand Down
Loading

0 comments on commit a3f5511

Please sign in to comment.