Merge pull request #29471 from overleaf/revert-29369-mfb-from-joi-to-zod-clsi-cache

Revert "migrate from joi to zod CLSI-CACHE service"

GitOrigin-RevId: 1846e5a1d990f7ff22982fc32277e24d69e9d1e0
This commit is contained in:
Maria Florencia Besteiro Gonzalez
2025-11-03 09:06:10 +00:00
committed by Copybot
parent 1720314726
commit a88c307962
6 changed files with 24 additions and 28 deletions
@@ -1,17 +0,0 @@
const { isZodErrorLike, fromError } = require('zod-validation-error')
/**
* @typedef {import('express').ErrorRequestHandler} ErrorRequestHandler
*/
const handleValidationError = [
/** @type {ErrorRequestHandler} */
(err, req, res, next) => {
if (!isZodErrorLike(err)) {
return next(err)
}
res.status(400).json({ ...fromError(err), statusCode: 400 })
},
]
module.exports = { handleValidationError }
-2
View File
@@ -2,12 +2,10 @@ const { ParamsError } = require('./Errors')
const { z } = require('zod')
const { zz } = require('./zodHelpers')
const { validateReq } = require('./validateReq')
const { handleValidationError } = require('./handleValidationError')
module.exports = {
z,
zz,
validateReq,
handleValidationError,
ParamsError,
}
+1 -2
View File
@@ -22,8 +22,7 @@
"dependencies": {
"@overleaf/o-error": "*",
"mongodb": "^6.12.0",
"zod": "^4.1.8",
"zod-validation-error": "^4.0.1"
"zod": "^4.1.8"
},
"devDependencies": {
"typescript": "^5.0.4",