mirror of
https://github.com/bubblecup-12/VogelSocialMedia.git
synced 2025-07-09 12:08:47 +00:00
added function to the login
This commit is contained in:
parent
897e8dbed9
commit
c32e345d3d
8 changed files with 292 additions and 174 deletions
|
@ -11,8 +11,10 @@ export function validateData(schema: z.ZodObject<any, any>) {
|
|||
} catch (error) {
|
||||
if (error instanceof ZodError) {
|
||||
const errorMessages = error.errors.map((issue: any) => ({
|
||||
message: `${issue.path.join(".")} is ${issue.message}`,
|
||||
}));
|
||||
path: issue.path.join("."),
|
||||
message: issue.message,
|
||||
}));
|
||||
|
||||
res
|
||||
.status(StatusCodes.BAD_REQUEST)
|
||||
.json({ error: "Invalid data", details: errorMessages });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue