Compare commits

..

3 Commits

Author SHA1 Message Date
fd6311516f update packages 2023-10-10 13:48:17 +03:00
81acc54dc9 update packages 2023-10-06 17:21:40 +03:00
c12338410f fast fix 2023-09-20 13:35:31 +03:00
2 changed files with 5 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "axp-server", "name": "axp-server",
"version": "1.4.13", "version": "1.4.15",
"description": "My helper library", "description": "My helper library",
"author": "AntoXa PRO <info@antoxa.pro>", "author": "AntoXa PRO <info@antoxa.pro>",
"homepage": "https://antoxahub.ru/antoxa/axp-server", "homepage": "https://antoxahub.ru/antoxa/axp-server",
@@ -20,16 +20,16 @@
"prepare": "npm run build" "prepare": "npm run build"
}, },
"dependencies": { "dependencies": {
"axp-ts": "^1.9.10", "axp-ts": "^1.11.3",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"express": "^4.18.2", "express": "^4.18.2",
"mongoose": "^6.12.0" "mongoose": "^6.12.0"
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-typescript": "^11.1.3", "@rollup/plugin-typescript": "^11.1.5",
"@types/express": "^4.17.17", "@types/express": "^4.17.18",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"rollup": "^3.29.2", "rollup": "^3.29.4",
"tslib": "^2.6.2" "tslib": "^2.6.2"
} }
} }

View File

@@ -94,16 +94,3 @@ export const zodMiddle =
next(httpError) next(httpError)
} }
} }
export const validFormMiddle =
(model: IFormModel<any>) =>
(req: Request, {}: Response, next: NextFunction) => {
if (model.isValid()) {
req.body = model.obj
next()
} else {
const httpError = new HttpError({ statusCode: 400 })
httpError.errors = model.errors
next(httpError)
}
}