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:
15
apps/Backend/src/storage/ai-settings-storage.ts
Normal file
15
apps/Backend/src/storage/ai-settings-storage.ts
Normal 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 },
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user