Skip to content

Commit

Permalink
Change parameter name for slug
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb committed Jan 22, 2024
1 parent 318c8ab commit ace7c33
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/drawers/WorkspaceDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/hooks/api/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetWorkspaceResponse>(`/workspaces/${workspaceId}`);
const res = await axios.get<GetWorkspaceResponse>(`/workspaces/${workspaceSlug}`);
return res.data;
},
meta: {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const codePairRoutes = [
element: <WorkspaceLayout />,
children: [
{
path: ":workspaceId",
path: ":workspaceSlug",
element: <WorkspaceIndex />,
},
],
Expand Down

0 comments on commit ace7c33

Please sign in to comment.