mirror of
https://github.com/umami-software/umami.git
synced 2026-02-17 02:55:38 +01:00
Get localized error messages.
This commit is contained in:
parent
baba06c692
commit
fc01ee9f56
32 changed files with 90 additions and 85 deletions
|
|
@ -14,7 +14,7 @@ import { ROLES } from '@/lib/constants';
|
|||
|
||||
export function UserAddForm({ onSave, onClose }) {
|
||||
const { mutate, error, isPending } = useUpdateQuery(`/users`);
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { formatMessage, labels, getErrorMessage } = useMessages();
|
||||
|
||||
const handleSubmit = async (data: any) => {
|
||||
mutate(data, {
|
||||
|
|
@ -26,7 +26,7 @@ export function UserAddForm({ onSave, onClose }) {
|
|||
};
|
||||
|
||||
return (
|
||||
<Form onSubmit={handleSubmit} error={error}>
|
||||
<Form onSubmit={handleSubmit} error={getErrorMessage(error)}>
|
||||
<FormField
|
||||
label={formatMessage(labels.username)}
|
||||
name="username"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue