use camelcase file names from now on...
This commit is contained in:
37
src/utilities/zodTypes.ts
Normal file
37
src/utilities/zodTypes.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const loginAccountSchema = z.object({
|
||||
username: z
|
||||
.string()
|
||||
.min(3, { message: 'Name must be at least 3 characters long' })
|
||||
.max(255, { message: 'Name must be at most 255 characters long' })
|
||||
.regex(/^[A-Za-z][A-Za-z0-9_-]*$/, { message: 'Name must start with a letter and can only contain letters, numbers, underscores, or dashes' }),
|
||||
password: z
|
||||
.string()
|
||||
.min(8, {
|
||||
message: 'Password must be at least 8 characters long'
|
||||
})
|
||||
.max(255)
|
||||
})
|
||||
|
||||
export const registerAccountSchema = z.object({
|
||||
username: z
|
||||
.string()
|
||||
.min(3, { message: 'Name must be at least 3 characters long' })
|
||||
.max(255, { message: 'Name must be at most 255 characters long' })
|
||||
.regex(/^[A-Za-z][A-Za-z0-9_-]*$/, { message: 'Name must start with a letter and can only contain letters, numbers, underscores, or dashes' }),
|
||||
password: z
|
||||
.string()
|
||||
.min(8, {
|
||||
message: 'Password must be at least 8 characters long'
|
||||
})
|
||||
.max(255)
|
||||
})
|
||||
|
||||
export const ZCharacterCreate = z.object({
|
||||
name: z
|
||||
.string()
|
||||
.min(3, { message: 'Name must be at least 3 characters long' })
|
||||
.max(255, { message: 'Name must be at most 255 characters long' })
|
||||
.regex(/^[A-Za-z][A-Za-z0-9_-]*$/, { message: 'Name must start with a letter and can only contain letters, numbers, underscores, or dashes' })
|
||||
})
|
Reference in New Issue
Block a user