mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 17:15:37 +01:00
Fix yup.
This commit is contained in:
parent
e6eb9a487e
commit
febf085aca
1 changed files with 2 additions and 2 deletions
|
|
@ -21,11 +21,11 @@ export function getFilterValidation(matchRegex) {
|
||||||
export const TimezoneTest = yup.string().test(
|
export const TimezoneTest = yup.string().test(
|
||||||
'timezone',
|
'timezone',
|
||||||
() => `Invalid timezone`,
|
() => `Invalid timezone`,
|
||||||
value => !value || !moment.tz.zone(value),
|
value => moment.tz.zone(value) !== null,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const UnitTypeTest = yup.string().test(
|
export const UnitTypeTest = yup.string().test(
|
||||||
'unit',
|
'unit',
|
||||||
() => `Invalid unit`,
|
() => `Invalid unit`,
|
||||||
value => !value || !UNIT_TYPES.includes(value),
|
value => UNIT_TYPES.includes(value),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue