Skip to content

Commit

Permalink
migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftugandan committed Dec 3, 2024
1 parent 21c815d commit 950df6d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
42 changes: 42 additions & 0 deletions packages/api/drizzle/meta/0015_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "6",
"dialect": "sqlite",
"id": "0015_add_custom_api_key",
"prevId": "0014_Gemini_Integration",
"tables": {
"config": {
"name": "config",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"openai_api_key": {
"name": "openai_api_key",
"type": "text"
},
"posthog_api_key": {
"name": "posthog_api_key",
"type": "text"
},
"subscription_email": {
"name": "subscription_email",
"type": "text"
},
"custom_api_key": {
"name": "custom_api_key",
"type": "text"
}
}
}
},
"enums": {},
"schemas": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
7 changes: 5 additions & 2 deletions packages/web/src/routes/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ export function AiSettings({ saveButtonLabel }: AiSettingsProps) {

const customModelSaveEnabled =
(typeof configCustomApiKey === 'string' && customApiKey !== configCustomApiKey) ||
((configCustomApiKey === null || configCustomApiKey === undefined) && customApiKey.length > 0) ||
((configCustomApiKey === null || configCustomApiKey === undefined) &&
customApiKey.length > 0) ||
(typeof aiBaseUrl === 'string' && baseUrl !== aiBaseUrl) ||
((aiBaseUrl === null || aiBaseUrl === undefined) && baseUrl.length > 0) ||
model !== aiModel;
Expand Down Expand Up @@ -419,7 +420,9 @@ export function AiSettings({ saveButtonLabel }: AiSettingsProps) {
<div className="flex justify-end">
<Button
className="px-5"
onClick={() => updateConfigContext({ aiBaseUrl: baseUrl, customApiKey, aiModel: model })}
onClick={() =>
updateConfigContext({ aiBaseUrl: baseUrl, customApiKey, aiModel: model })
}
disabled={!customModelSaveEnabled}
>
{saveButtonLabel ?? 'Save'}
Expand Down

0 comments on commit 950df6d

Please sign in to comment.