Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d45343

Browse files
authored
fix(site): select default organization on /organizations page (#13992)
1 parenta61c09e commit0d45343

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎site/src/pages/ManagementSettingsPage/ManagementSettingsLayout.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ export const ManagementSettingsLayout: FC = () => {
6161
currentOrganizationId:!inOrganizationSettings
6262
?undefined
6363
:!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+
),
6869
organizations:organizationsQuery.data,
6970
}}
7071
>
@@ -93,3 +94,9 @@ export const ManagementSettingsLayout: FC = () => {
9394
</RequirePermission>
9495
);
9596
};
97+
98+
constgetOrganizationIdByName=(organizations:Organization[],name:string)=>
99+
organizations.find((org)=>org.name===name)?.id;
100+
101+
constgetOrganizationIdByDefault=(organizations:Organization[])=>
102+
organizations.find((org)=>org.is_default)?.id;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp