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-10-31 18:02:21 +01:00
committed by Copybot
parent 1720314726
commit a88c307962
6 changed files with 24 additions and 28 deletions

View File

@@ -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 }