mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-15 03:09:56 -06:00
* 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>
10 lines
290 B
TypeScript
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;
|
|
};
|