Correctly handle grant_target

This commit is contained in:
Gildas Garcia committed 2026-10-01 11:53:24 +02:00
1 parent 15348cfb07
commit 313b128b83
2 files changed
+9 -3

No files matched your search

@@ -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
</p>
</div>
</TableCell>
<TableCell>{approval.org_grant ? 'Organization' : 'Members'}</TableCell>
<TableCell>{getGrantTargetLabel(approval.grant_target)}</TableCell>
</TableRow>
)
}
const getGrantTargetLabel = (target: OAuthApprovalTarget) => {
if (target === 'members') return 'Members'
if (target === 'organization') return 'Organization'
return 'Organization & members'
}
+1 -1
View File
@@ -329,7 +329,7 @@ const MOCK_APPROVALS: ListOAuthApprovalsResponse = {
icon: null,
created_by: '',
},
grant_target: 'members',
grant_target: 'organization_and_members',
org_grant: null,
},
{