add niceId to provider

This commit is contained in:
Owen
2026-08-14 09:30:44 -04:00
parent ee75a09f8c
commit f0f5e9219b
5 changed files with 171 additions and 93 deletions
@@ -25,6 +25,7 @@ import {
refineProviderUpstreamFields
} from "@server/routers/aiProvider/validation";
import { serializeCapabilities } from "@server/lib/aiCapabilities";
import { getUniqueProviderName, getUniqueResourceName } from "@server/db/names";
const paramsSchema = z.strictObject({
orgId: z.string().nonempty()
@@ -133,11 +134,14 @@ export async function createAiProvider(
);
}
const niceId = await getUniqueProviderName(orgId);
const [provider] = await db
.insert(aiProviders)
.values({
orgId,
name,
niceId,
type,
upstreamUrl: resolved.upstreamUrl,
apiKey: encryptedApiKey,