File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,12 @@ import { isEveryoneGroup } from "utils/groups";
54
54
import { pageTitle } from "utils/page" ;
55
55
56
56
export const GroupPage : FC = ( ) => {
57
- const { groupName, organization } = useParams ( ) as {
58
- organization : string ;
57
+ const { groupName } = useParams ( ) as {
59
58
groupName : string ;
60
59
} ;
61
60
const queryClient = useQueryClient ( ) ;
62
61
const navigate = useNavigate ( ) ;
63
- const groupQuery = useQuery ( group ( organization , groupName ) ) ;
62
+ const groupQuery = useQuery ( group ( "default" , groupName ) ) ;
64
63
const groupData = groupQuery . data ;
65
64
const { data : permissions } = useQuery (
66
65
groupData !== undefined
Original file line number Diff line number Diff line change @@ -61,10 +61,11 @@ export const ManagementSettingsLayout: FC = () => {
61
61
currentOrganizationId : ! inOrganizationSettings
62
62
? undefined
63
63
: ! organization
64
- ? "00000000-0000-0000-0000-000000000000"
65
- : organizationsQuery . data . find (
66
- ( org ) => org . name === organization ,
67
- ) ?. id ,
64
+ ? getOrganizationIdByDefault ( organizationsQuery . data )
65
+ : getOrganizationIdByName (
66
+ organizationsQuery . data ,
67
+ organization ,
68
+ ) ,
68
69
organizations : organizationsQuery . data ,
69
70
} }
70
71
>
@@ -93,3 +94,9 @@ export const ManagementSettingsLayout: FC = () => {
93
94
</ RequirePermission >
94
95
) ;
95
96
} ;
97
+
98
+ const getOrganizationIdByName = ( organizations : Organization [ ] , name : string ) =>
99
+ organizations . find ( ( org ) => org . name === name ) ?. id ;
100
+
101
+ const getOrganizationIdByDefault = ( organizations : Organization [ ] ) =>
102
+ organizations . find ( ( org ) => org . is_default ) ?. id ;
You can’t perform that action at this time.
0 commit comments