16 lines
482 B
TypeScript
16 lines
482 B
TypeScript
import { z } from 'zod'
|
|
|
|
const PersonContactBaseSchema = z.object({
|
|
contactType: z.string().min(1, 'Mohon pilih tipe kontak'),
|
|
contactNumber: z.string().min(8, 'Nomor minimal 8 digit'),
|
|
})
|
|
|
|
const PersonContactListSchema = z.object({
|
|
contacts: z.array(PersonContactBaseSchema).min(1, 'Minimal 1 kontak'),
|
|
})
|
|
|
|
type PersonContactFormData = z.infer<typeof PersonContactListSchema>
|
|
|
|
export { PersonContactListSchema, PersonContactBaseSchema }
|
|
export type { PersonContactFormData }
|