mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-15 16:59:35 +02:00
add niceId to provider
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user