Initial commit: PC Builder AdonisJS project
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import vine from '@vinejs/vine'
|
||||
|
||||
export const registerValidator = vine.compile(
|
||||
vine.object({
|
||||
name: vine.string().minLength(3).maxLength(64),
|
||||
email: vine
|
||||
.string()
|
||||
.email()
|
||||
.unique(async (query, field) => {
|
||||
const user = await query.from('users').where('email', field).first()
|
||||
return !user
|
||||
}),
|
||||
password: vine.string().minLength(8).maxLength(32),
|
||||
})
|
||||
)
|
||||
Reference in New Issue
Block a user