mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Correctly handle grant_target
This commit is contained in:
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'
|
||||
}
|
||||
@@ -329,7 +329,7 @@ const MOCK_APPROVALS: ListOAuthApprovalsResponse = {
|
||||
icon: null,
|
||||
created_by: '',
|
||||
},
|
||||
grant_target: 'members',
|
||||
grant_target: 'organization_and_members',
|
||||
org_grant: null,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user