3cac23ce8a
fix: id list for contacts and address list fix warning fix duplicate contacts responsible: true fix edit family fix nik required
18 lines
603 B
TypeScript
18 lines
603 B
TypeScript
import { z } from 'zod'
|
|
|
|
const PersonContactBaseSchema = z.object({
|
|
id: z.number().optional(),
|
|
|
|
contactType: z.string({ required_error: 'Mohon pilih tipe kontak' }).min(1, 'Mohon pilih tipe kontak'),
|
|
contactNumber: z.string({ required_error: 'Nomor kontak harus diisi' }).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 }
|