( error: z.ZodError, message = 'Validation error', status = 400 )
| 69 | } |
| 70 | |
| 71 | export function validationErrorResponse( |
| 72 | error: z.ZodError, |
| 73 | message = 'Validation error', |
| 74 | status = 400 |
| 75 | ): NextResponse<ValidationErrorBody> { |
| 76 | return NextResponse.json({ error: message, details: serializeZodIssues(error) }, { status }) |
| 77 | } |
| 78 | |
| 79 | export function getValidationErrorMessage( |
| 80 | error: z.ZodError, |
no test coverage detected