Skip to content

Commit

Permalink
Added sample data in dashboard and updated welcome form.
Browse files Browse the repository at this point in the history
  • Loading branch information
SarveshMina committed Mar 5, 2025
1 parent 8b03f29 commit 312896f
Show file tree
Hide file tree
Showing 4 changed files with 521 additions and 256 deletions.
39 changes: 0 additions & 39 deletions backend/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from calendar_routes import get_events, create_event, update_event, delete_event
from user_profile_routes import get_user_profile, update_user_profile, get_avatar_upload_url
from account_routes import change_password, get_settings, update_settings
from module_routes import get_modules, create_or_update_module, delete_module

# We'll also import our helper from user_routes to verify session
from user_routes import verify_session
Expand Down Expand Up @@ -247,42 +246,4 @@ def settings_endpoint(req: func.HttpRequest) -> func.HttpResponse:
mimetype="application/json"
)

return add_cors_headers(response)



@app.route(route="modules", methods=["GET", "POST", "OPTIONS"], auth_level=func.AuthLevel.ANONYMOUS)
def modules_endpoint(req: func.HttpRequest) -> func.HttpResponse:
if req.method == "OPTIONS":
return cors_preflight_response()

if req.method == "GET":
response = get_modules(req)
elif req.method == "POST":
response = create_or_update_module(req)
else:
response = func.HttpResponse(
json.dumps({"error": f"Method {req.method} not allowed"}),
status_code=405,
mimetype="application/json"
)

return add_cors_headers(response)

@app.route(route="modules/{id}", methods=["PUT", "DELETE", "OPTIONS"], auth_level=func.AuthLevel.ANONYMOUS)
def module_by_id_endpoint(req: func.HttpRequest) -> func.HttpResponse:
if req.method == "OPTIONS":
return cors_preflight_response()

if req.method == "PUT":
response = create_or_update_module(req)
elif req.method == "DELETE":
response = delete_module(req)
else:
response = func.HttpResponse(
json.dumps({"error": f"Method {req.method} not allowed"}),
status_code=405,
mimetype="application/json"
)

return add_cors_headers(response)
File renamed without changes.
Loading

0 comments on commit 312896f

Please sign in to comment.