[Fix] UI - Keys: Organization shows Not Set due to org_id/organization_id mismatch

The /key/list API returns `org_id` (the Pydantic field name), but the UI
was reading `organization_id`, causing the Organization field to always
show "Not Set" and the Organization ID filter to never match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-04 20:11:42 -08:00
parent 38ea5aba80
commit 51d876ce79
4 changed files with 4 additions and 3 deletions

View file

@ -210,7 +210,7 @@ export function VirtualKeysTable({ teams, organizations, onSortChange, currentSo
},
{
id: "organization_id",
accessorKey: "organization_id",
accessorKey: "org_id",
header: "Organization ID",
size: 140,
enableSorting: false,

View file

@ -96,7 +96,7 @@ export function useFilterLogic({
// Apply Organization ID filter
if (filters["Organization ID"]) {
result = result.filter((key) => key.organization_id === filters["Organization ID"]);
result = result.filter((key) => (key.organization_id ?? key.org_id) === filters["Organization ID"]);
}
setFilteredKeys(result);

View file

@ -47,6 +47,7 @@ export interface KeyResponse {
blocked: boolean;
litellm_budget_table: Record<string, unknown>;
organization_id: string | null;
org_id?: string | null;
created_at: string;
updated_at: string;
last_active: string | null;

View file

@ -644,7 +644,7 @@ export default function KeyInfoView({
<div>
<Text className="font-medium">Organization</Text>
<Text>{currentKeyData.organization_id || "Not Set"}</Text>
<Text>{(currentKeyData.organization_id ?? currentKeyData.org_id) || "Not Set"}</Text>
</div>
<div>