feat: pages publiées utilisateur (settings) + fix import Shield dupliqué
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 0s
CI / Deploy production (on server) (push) Has been skipped

- /settings/published : l'utilisateur voit ses notes publiées
  - Copier le lien, ouvrir, dépublier
  - API /api/user/published
- Onglet 'Mes pages' (Globe) dans la nav settings
- Fix: import Shield dupliqué dans admin-sidebar.tsx
- i18n FR/EN
This commit is contained in:
Antigravity
2026-06-20 07:21:02 +00:00
parent 722cb905e4
commit 3f3d37ebeb
6 changed files with 127 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import { NextResponse } from 'next/server'
import { auth } from '@/auth'
import prisma from '@/lib/prisma'
export async function GET() {
const session = await auth()
if (!session?.user?.id) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
const notes = await prisma.note.findMany({
where: { userId: session.user.id, isPublic: true, trashedAt: null },
select: { id: true, title: true, publicSlug: true, publishedAt: true },
orderBy: { publishedAt: 'desc' },
})
return NextResponse.json({ notes })
}