export interface ErrorResponse { lead: { agency: string[] | null; agency_client: string[] | null; }; agency_client: {} | null; portal_client: {} | null; } /** * Takes errors in the format they are returned by ActiveRecord validation from * our APIs (such as the leads API) and converts into array of errors consistent * with our other models. * * e.g. from this: * * ```json * { * "lead": { * "agency": [ * "can't be blank" * ], * "agency_client": [ * "can't be blank" * ] * }, * "agency_client": null, * "portal_client": {} * } * ``` * * to this: * * ```ts * [ * { message: 'lead: agency: can't be blank' }, * { message: 'lead: agency_client: can't be blank' }, * ] * ``` */ export default function formatErrors(errors: ErrorResponse | string[]): { message: string; }[]; //# sourceMappingURL=format-errors.d.ts.map