feat: add AI settings routes, storage, UI card, and migration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gitead
2026-05-06 08:58:58 -04:00
parent 8c162d7040
commit 4989201c62
5 changed files with 295 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { prisma as db } from "@repo/db/client";
export const aiSettingsStorage = {
async getAiSettings(userId: number) {
return db.aiSettings.findUnique({ where: { userId } });
},
async upsertAiSettings(userId: number, apiKey: string) {
return db.aiSettings.upsert({
where: { userId },
update: { apiKey },
create: { userId, apiKey },
});
},
};