Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c223cf

Browse files
committed
assume default
1 parent 9a5cc12 commit 1c223cf

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

site/src/pages/GroupsPage/CreateGroupPage.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ import { Helmet } from "react-helmet-async";
33
import { useMutation, useQueryClient } from "react-query";
44
import { useNavigate } from "react-router-dom";
55
import { createGroup } from "api/queries/groups";
6-
import { useDashboard } from "modules/dashboard/useDashboard";
76
import { pageTitle } from "utils/page";
87
import CreateGroupPageView from "./CreateGroupPageView";
98

109
export const CreateGroupPage: FC = () => {
1110
const queryClient = useQueryClient();
1211
const navigate = useNavigate();
1312
const createGroupMutation = useMutation(createGroup(queryClient, "default"));
14-
const { experiments } = useDashboard();
1513

1614
return (
1715
<>
@@ -21,13 +19,7 @@ export const CreateGroupPage: FC = () => {
2119
<CreateGroupPageView
2220
onSubmit={async (data) => {
2321
const newGroup = await createGroupMutation.mutateAsync(data);
24-
25-
let groupURL = `/groups/${newGroup.name}`;
26-
if (experiments.includes("multi-organization")) {
27-
groupURL = `/organizations/${newGroup.organization_id}/groups/${newGroup.name}`;
28-
}
29-
30-
navigate(groupURL);
22+
navigate(`/groups/${newGroup.name}`);
3123
}}
3224
error={createGroupMutation.error}
3325
isLoading={createGroupMutation.isLoading}

site/src/pages/GroupsPage/GroupPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ import { isEveryoneGroup } from "utils/groups";
5454
import { pageTitle } from "utils/page";
5555

5656
export const GroupPage: FC = () => {
57-
const { groupName, organization } = useParams() as {
58-
organization: string;
57+
const { groupName } = useParams() as {
5958
groupName: string;
6059
};
6160
const queryClient = useQueryClient();
@@ -64,7 +63,7 @@ export const GroupPage: FC = () => {
6463
// is /groups/:groupName, which does not include the organization. So the orgID cannot
6564
// be inferred from the URL. The organization is only included in the url when the multi-org
6665
// experiment is enabled.
67-
const groupQuery = useQuery(group(organization ?? "default", groupName));
66+
const groupQuery = useQuery(group("default", groupName));
6867
const groupData = groupQuery.data;
6968
const { data: permissions } = useQuery(
7069
groupData !== undefined

0 commit comments

Comments
 (0)