feat: add validators for username, email, password

* not passed yet
This commit is contained in:
Lin, Hung-Shin authored and Annie Huang committed 2023-11-12 21:23:12 +08:00
1 parent 6a64f75950
commit 040b2a71e5
4 files changed
+82 -76

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import { validationResult } from 'express-validator'
export function noError(req, res, next) {
const result = validationResult(req)
if (result.isEmpty()) {
next()
return
}
console.log(result.array())
res.status(400).json({
errors: result.array(),
})
}