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
|
|
@ -31,7 +31,7 @@ export function CohortEditForm({
|
|||
onClose?: () => void;
|
||||
}) {
|
||||
const { data } = useWebsiteCohortQuery(websiteId, cohortId);
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { formatMessage, labels, messages, getErrorMessage } = useMessages();
|
||||
|
||||
const { mutate, error, isPending, touch, toast } = useUpdateQuery(
|
||||
`/websites/${websiteId}/segments${cohortId ? `/${cohortId}` : ''}`,
|
||||
|
|
@ -60,7 +60,11 @@ export function CohortEditForm({
|
|||
};
|
||||
|
||||
return (
|
||||
<Form error={error} onSubmit={handleSubmit} defaultValues={data || defaultValues}>
|
||||
<Form
|
||||
error={getErrorMessage(error)}
|
||||
onSubmit={handleSubmit}
|
||||
defaultValues={data || defaultValues}
|
||||
>
|
||||
{({ watch }) => {
|
||||
const type = watch('parameters.action.type');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue