diff --git a/dashboard/src/features/users/types/schema.ts b/dashboard/src/features/users/types/schema.ts index 6d6fc22..46b853a 100644 --- a/dashboard/src/features/users/types/schema.ts +++ b/dashboard/src/features/users/types/schema.ts @@ -5,9 +5,9 @@ export const UserSchema = z.object({ username: z.string().min(1, { message: 'Username is required' }), note: z.string().nullable(), data_limit: z - .union([z.string().transform((str) => (Number(str) * DATA_LIMIT_METRIC)), z.number()]) + .union([z.string().transform((str) => (Number(str))), z.number()]) .refine(val => val >= 0, { message: 'The minimum number is 0' }) - .transform((val) => Math.round(val) ?? 0) + .transform((val) => (Math.round(val) ?? 0) * DATA_LIMIT_METRIC) .nullable() .optional(), data_limit_reset_strategy: z