Improve configuration saving for AI models in settings

Update the OpenRouter configuration route to handle updates more gracefully, allowing API keys to remain unchanged if not explicitly provided.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/35Hxx7C
This commit is contained in:
michaelschal committed 2025-10-02 06:14:05 +00:00
1 parent 4182ed10e5
commit 70dd8a4c87
3 files changed
+23 -11

No files matched your search

+4
View File
@@ -226,6 +226,10 @@ export const insertOpenrouterConfigSchema = createInsertSchema(openrouterConfig)
updatedAt: true,
});
export const updateOpenrouterConfigSchema = insertOpenrouterConfigSchema.partial({
apiKey: true,
});
// Types
export type User = typeof users.$inferSelect;
export type InsertUser = z.infer<typeof insertUserSchema>;