How to set the error message in zod refine method?
I have the following Zod schema: const createApSchema = z .object({ name: z.string().min(1).max(32), isActive: z.boolean().default(true), description: z.string().max(200).optional(), ip: z.string().refine(validator.isIP), accessMode: AccessModeEnum, apiUsername: z.string().optional(), apiPassword: z.string().optional(), apiVersion: ApiVersionEnum, community: z.string().optional(), }) .refine((data) => { // check to see if AP type is snmp to force the community field const isSnmp = data.accessMode !== AccessModeEnumMap[AccessModeEnum.enum.mikrotikApi] if (isSnmp… Read More How to set the error message in zod refine method?