Files
formbricks/apps/web/lib/api/validator.ts
Matti Nannt 97263a66cc Add new client endpoints & webhook functionality (#355)
* add new zod schema for responses
* add new client endpoints for responses
* add services for responses and surveys
* add new responses model to webhooks & email

---------

Co-authored-by: Johannes <johannes@formbricks.com>
2023-06-12 19:51:13 +02:00

10 lines
290 B
TypeScript

import { ZodError } from "zod";
export const transformErrorToDetails = (error: ZodError<any>): { [key: string]: string } => {
const details: { [key: string]: string } = {};
for (const issue of error.issues) {
details[issue.path.join(".")] = issue.message;
}
return details;
};