feat(insights): fix DBSCAN, Persian embeddings crash, D3 physics layouts, and D3 node not found runtime error
This commit is contained in:
24
memento-note/app/api/clip/notebooks/route.ts
Normal file
24
memento-note/app/api/clip/notebooks/route.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { auth } from '@/auth'
|
||||
import prisma from '@/lib/prisma'
|
||||
|
||||
/** Liste hiérarchique des carnets pour le clipper (extension). */
|
||||
export async function GET(_request: NextRequest) {
|
||||
try {
|
||||
const session = await auth()
|
||||
if (!session?.user?.id) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
||||
}
|
||||
|
||||
const notebooks = await prisma.notebook.findMany({
|
||||
where: { userId: session.user.id, trashedAt: null },
|
||||
select: { id: true, name: true, parentId: true, color: true },
|
||||
orderBy: [{ order: 'asc' }, { name: 'asc' }],
|
||||
})
|
||||
|
||||
return NextResponse.json({ notebooks })
|
||||
} catch (error) {
|
||||
console.error('[GET /api/clip/notebooks]', error)
|
||||
return NextResponse.json({ error: 'Failed to load notebooks' }, { status: 500 })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user