From 313b128b834d806b82d553776cbfef1df78309bc Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:53:24 +0200 Subject: [PATCH] Correctly handle `grant_target` --- .../Organization/OAuthApps/OAuthAppsAuthorizedRow.tsx | 10 ++++++++-- apps/studio/data/oauth-apps/mocks.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppsAuthorizedRow.tsx b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppsAuthorizedRow.tsx index 040fce90265..550c3118e58 100644 --- a/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppsAuthorizedRow.tsx +++ b/apps/studio/components/interfaces/Organization/OAuthApps/OAuthAppsAuthorizedRow.tsx @@ -1,6 +1,6 @@ import { TableCell, TableRow } from 'ui' -import type { OAuthApprovalItem } from '@/data/oauth-apps/types' +import type { OAuthApprovalItem, OAuthApprovalTarget } from '@/data/oauth-apps/types' export interface OAuthAppsAuthorizedRowProps { approval: OAuthApprovalItem @@ -22,7 +22,13 @@ export const OAuthAppsAuthorizedRow = ({ approval }: OAuthAppsAuthorizedRowProps

- {approval.org_grant ? 'Organization' : 'Members'} + {getGrantTargetLabel(approval.grant_target)} ) } + +const getGrantTargetLabel = (target: OAuthApprovalTarget) => { + if (target === 'members') return 'Members' + if (target === 'organization') return 'Organization' + return 'Organization & members' +} diff --git a/apps/studio/data/oauth-apps/mocks.ts b/apps/studio/data/oauth-apps/mocks.ts index 22bb5a84b43..fe3784e8c7e 100644 --- a/apps/studio/data/oauth-apps/mocks.ts +++ b/apps/studio/data/oauth-apps/mocks.ts @@ -329,7 +329,7 @@ const MOCK_APPROVALS: ListOAuthApprovalsResponse = { icon: null, created_by: '', }, - grant_target: 'members', + grant_target: 'organization_and_members', org_grant: null, }, {