From ace7c33c010f5708ed5558fe99766e48ad076585 Mon Sep 17 00:00:00 2001 From: devleejb Date: Mon, 22 Jan 2024 13:48:02 +0900 Subject: [PATCH] Change parameter name for slug --- frontend/src/components/drawers/WorkspaceDrawer.tsx | 2 +- frontend/src/hooks/api/workspace.ts | 8 ++++---- frontend/src/routes.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/drawers/WorkspaceDrawer.tsx b/frontend/src/components/drawers/WorkspaceDrawer.tsx index 1ded594b..160e0ecc 100644 --- a/frontend/src/components/drawers/WorkspaceDrawer.tsx +++ b/frontend/src/components/drawers/WorkspaceDrawer.tsx @@ -26,7 +26,7 @@ const DRAWER_WIDTH = 240; function WorkspaceDrawer() { const params = useParams(); const userStore = useSelector(selectUser); - const { data: workspace } = useGetWorkspaceQuery(params.workspaceId); + const { data: workspace } = useGetWorkspaceQuery(params.workspaceSlug); const [profileAnchorEl, setProfileAnchorEl] = useState<(EventTarget & Element) | null>(null); const [workspaceListAnchorEl, setWorkspaceListAnchorEl] = useState< (EventTarget & Element) | null diff --git a/frontend/src/hooks/api/workspace.ts b/frontend/src/hooks/api/workspace.ts index cb98612e..f5264303 100644 --- a/frontend/src/hooks/api/workspace.ts +++ b/frontend/src/hooks/api/workspace.ts @@ -10,12 +10,12 @@ export const generateGetWorkspaceListQueryKey = () => { return ["workspaces"]; }; -export const useGetWorkspaceQuery = (workspaceId?: string) => { +export const useGetWorkspaceQuery = (workspaceSlug?: string) => { const query = useQuery({ - queryKey: generateGetWorkspaceQueryKey(workspaceId || ""), - enabled: Boolean(workspaceId), + queryKey: generateGetWorkspaceQueryKey(workspaceSlug || ""), + enabled: Boolean(workspaceSlug), queryFn: async () => { - const res = await axios.get(`/workspaces/${workspaceId}`); + const res = await axios.get(`/workspaces/${workspaceSlug}`); return res.data; }, meta: { diff --git a/frontend/src/routes.tsx b/frontend/src/routes.tsx index ff06a4bb..db634f7a 100644 --- a/frontend/src/routes.tsx +++ b/frontend/src/routes.tsx @@ -32,7 +32,7 @@ const codePairRoutes = [ element: , children: [ { - path: ":workspaceId", + path: ":workspaceSlug", element: , }, ],