-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
347f2ad
commit b54377d
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from auth import ( | ||
AuthBearer, | ||
get_current_user, # Assuming you have a get_current_user function | ||
) | ||
from fastapi import APIRouter, Depends | ||
from models.databases.supabase.onboarding import OnboardingUpdatableProperties | ||
from models.user_identity import UserIdentity | ||
from repository.onboarding.get_user_onboarding import get_user_onboarding | ||
from repository.onboarding.udpate_user_onboarding import update_user_onboarding | ||
|
||
onboarding_router = APIRouter() | ||
|
||
|
||
@onboarding_router.get( | ||
"/onboarding", | ||
dependencies=[Depends(AuthBearer())], | ||
tags=["Onboarding"], | ||
) | ||
async def get_user_onboarding_handler( | ||
current_user: UserIdentity = Depends(get_current_user), | ||
): | ||
""" | ||
Get user onboarding information for the current user | ||
""" | ||
|
||
return get_user_onboarding(current_user.id) | ||
|
||
|
||
@onboarding_router.put( | ||
"/onboarding", | ||
dependencies=[Depends(AuthBearer())], | ||
tags=["Onboarding"], | ||
) | ||
async def update_user_onboarding_handler( | ||
onboarding: OnboardingUpdatableProperties, | ||
current_user: UserIdentity = Depends(get_current_user), | ||
): | ||
""" | ||
Update user onboarding information for the current user | ||
""" | ||
|
||
return update_user_onboarding(current_user.id, onboarding) |