feat: modération IA automatique à la publication
- 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:
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user