feat: modération IA automatique à la publication
Some checks failed
CI / Lint, Unit Tests & Build (push) Successful in 5m30s
CI / Deploy production (on server) (push) Failing after 0s

- contentModerationService branché dans /api/notes/publish
- blocked → 403, publication refusée, toast d'explication
- flagged → publié mais admins notifiés pour révision
- safe → publication normale
- PublishDialog gère les 3 cas (succès normal, flagged, blocked)
- i18n FR/EN
This commit is contained in:
Antigravity
2026-06-20 07:51:44 +00:00
parent 1774544385
commit 17594124b0
4 changed files with 55 additions and 3 deletions

View File

@@ -41,7 +41,18 @@ export function PublishDialog({ open, onClose, noteId, noteTitle, isPublic: init
if (res.ok && data.slug) {
setIsPublic(true)
setSlug(data.slug)
toast.success(t('richTextEditor.publishSuccess') || 'Note publiée !')
if (data.moderation === 'flagged') {
toast.success(t('richTextEditor.publishSuccess') || 'Note publiée !', {
description: '⚠️ Un modérateur examinera le contenu sous peu.',
})
} else {
toast.success(t('richTextEditor.publishSuccess') || 'Note publiée !')
}
} else if (data.error === 'blocked') {
toast.error(t('richTextEditor.publishBlocked') || 'Publication refusée', {
description: data.reason || 'Le contenu ne respecte pas les règles de publication.',
duration: 6000,
})
} else {
toast.error(data.error || 'Erreur')
}