From f7c2c58131baa0b7aad382c66e83e9e5a5f2a61d Mon Sep 17 00:00:00 2001 From: Dennis Chen Date: Wed, 12 Jun 2024 10:05:29 -0700 Subject: [PATCH] fixes --- frontend/src/App.tsx | 1 - frontend/src/pages/Home.tsx | 162 ++++++++++++++++++------------------ store/app/routers/part.py | 5 +- 3 files changed, 85 insertions(+), 83 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d5456dd0..6cf0555b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -6,7 +6,6 @@ import { AlertQueue, AlertQueueProvider } from "hooks/alerts"; import { AuthenticationProvider } from "hooks/auth"; import { ThemeProvider } from "hooks/theme"; import About from "pages/About"; -import EditPartForm from "pages/EditPartForm"; import EditRobotForm from "pages/EditRobotForm"; import Home from "pages/Home"; import Login from "pages/Login"; diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index d02a3e59..9cf2d99e 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -43,86 +43,88 @@ const Home: React.FC = () => { - {isAuthenticated && <> - - - - - - - - - - - - - - - - - } + {isAuthenticated && ( + <> + + + + + + + + + + + + + + + + + + )} ); }; diff --git a/store/app/routers/part.py b/store/app/routers/part.py index f443a19c..eff90191 100644 --- a/store/app/routers/part.py +++ b/store/app/routers/part.py @@ -42,9 +42,10 @@ async def get_part(part_id: str, crud: Annotated[Crud, Depends(Crud.get)]) -> Pa @parts_router.get("/user/") async def current_user( - crud: Annotated[Crud, Depends(Crud.get)], data: Annotated[ApiKeyData, Depends(get_api_key)] + crud: Annotated[Crud, Depends(Crud.get)], + token: Annotated[str, Depends(get_session_token)], ) -> str | None: - user_id = await crud.get_user_id_from_api_key(data.api_key) + user_id = await crud.get_user_id_from_session_token(token) return str(user_id)