* MED-151: add profile view and working smoking dashboard card * update zod * move some components to shared * move some components to shared * remove console.logs * remove unused password form components * only check null for variant * use pathsconfig
22 lines
694 B
TypeScript
22 lines
694 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const accountSettingsSchema = z.object({
|
|
firstName: z
|
|
.string()
|
|
.min(1, { error: 'error:tooShort' })
|
|
.max(200, { error: 'error:tooLong' }),
|
|
lastName: z
|
|
.string()
|
|
.min(1, { error: 'error:tooShort' })
|
|
.max(200, { error: 'error:tooLong' }),
|
|
email: z.email({ error: 'error:invalidEmail' }).nullable(),
|
|
phone: z.e164({ error: 'error:invalidPhone' }),
|
|
accountParams: z.object({
|
|
height: z.coerce.number({ error: 'error:invalidNumber' }),
|
|
weight: z.coerce.number({ error: 'error:invalidNumber' }),
|
|
isSmoker: z.boolean().optional().nullable(),
|
|
}),
|
|
});
|
|
|
|
export type AccountSettings = z.infer<typeof accountSettingsSchema>;
|