feat(notes): vues structurées tableau/kanban, flashcards et MCP robuste
Ajoute la base organisable par carnet (schéma, champs partagés, valeurs par note) avec activation guidée, tableau éditable, kanban et suppression de colonnes. Corrige le multiselect en vue tableau et enrichit sidebar, grille et i18n FR/EN. Inclut aussi les améliorations flashcards SM-2, l'audit consentement IA et la robustesse du serveur MCP (config, validation, rate-limit, métriques). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { Prisma } from '@prisma/client'
|
||||
|
||||
export async function getOrCreateDeckForNotebook(params: {
|
||||
userId: string
|
||||
@@ -28,6 +29,14 @@ export async function getOrCreateDeckForNotebook(params: {
|
||||
notebookId,
|
||||
name: notebook.name,
|
||||
},
|
||||
}).catch(async (error) => {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError && error.code === 'P2002') {
|
||||
const raced = await prisma.flashcardDeck.findFirst({
|
||||
where: { userId, notebookId },
|
||||
})
|
||||
if (raced) return raced
|
||||
}
|
||||
throw error
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user