Added check on client side (api)
This commit is contained in:
@@ -20,8 +20,8 @@ export interface CalendarEvent {
|
||||
*/
|
||||
export const postEventBodySchema = z.object({
|
||||
event: z.object({
|
||||
title: z.string(),
|
||||
description: z.string().optional().nullable(),
|
||||
title: z.string().max(240),
|
||||
description: z.string().max(1200).optional().nullable(),
|
||||
location: z.string().optional().nullable(),
|
||||
startDate: dateSchema.required(),
|
||||
endDate: dateSchema.optional().nullable(),
|
||||
|
||||
14
models/Errors.ts
Normal file
14
models/Errors.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export interface ValidationError {
|
||||
path: (string | number)[]
|
||||
message: string
|
||||
code: string
|
||||
}
|
||||
|
||||
export interface APIError {
|
||||
statusCode: number
|
||||
statusMessage: string
|
||||
message: string
|
||||
data: {
|
||||
errors: ValidationError[]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user