fix: replace raw ai_consent_required code with translatable message and consent prompt
- Centralize AI consent 403 responses in server-consent helpers - Return human-readable message + code + i18n errorKey from all AI APIs - Update dashboard and AI clients to detect code/errorKey and translate - Add consent.ai.requiredToast i18n keys (fr/en)
This commit is contained in:
@@ -330,7 +330,7 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme
|
||||
duration: 6000,
|
||||
})
|
||||
} else {
|
||||
toast.error(data.error || t('general.error'))
|
||||
toast.error(data.errorKey ? t(data.errorKey) : (data.error || t('general.error')))
|
||||
}
|
||||
} catch {
|
||||
toast.error(t('general.error'))
|
||||
@@ -408,7 +408,7 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme
|
||||
})
|
||||
} else {
|
||||
toast.dismiss(toastId)
|
||||
toast.error(data.error || t('general.error'))
|
||||
toast.error(data.errorKey ? t(data.errorKey) : (data.error || t('general.error')))
|
||||
}
|
||||
} catch {
|
||||
toast.dismiss(toastId)
|
||||
@@ -437,7 +437,7 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme
|
||||
setPublishOpen(false)
|
||||
} else {
|
||||
const data = await res.json().catch(() => ({}))
|
||||
toast.error(data.error || t('general.error'))
|
||||
toast.error(data.errorKey ? t(data.errorKey) : (data.error || t('general.error')))
|
||||
}
|
||||
} catch {
|
||||
toast.error(t('general.error'))
|
||||
|
||||
Reference in New Issue
Block a user