@munlib/common 1.0.192 → 1.0.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,13 +7,12 @@ var erroresStatus_1 = require("../errors/erroresStatus");
|
|
|
7
7
|
var instituciones_pagos_1 = require("../events/types/instituciones-pagos");
|
|
8
8
|
var validateRequest = function (req, res, next) {
|
|
9
9
|
var errors = (0, express_validator_1.validationResult)(req);
|
|
10
|
-
console.log("VALIDATE REQUEST");
|
|
11
10
|
if (!errors.isEmpty()) {
|
|
12
11
|
console.log("VALIDATE REQUEST1111111", errors.array()[0]);
|
|
13
12
|
// Extraer el primer error y sus detalles personalizados (typeError y userMsg)
|
|
14
|
-
var msg = errors.array()[0].msg
|
|
15
|
-
var typeMsg =
|
|
16
|
-
var userMsg =
|
|
13
|
+
var msg = errors.array()[0].msg; // Primer error encontrado
|
|
14
|
+
var typeMsg = instituciones_pagos_1.ErrorCategories.SINTAX;
|
|
15
|
+
var userMsg = erroresStatus_1.ErrorController.getErrorMessage(instituciones_pagos_1.ErrorCategories.SINTAX);
|
|
17
16
|
// Lanzar RequestValidationError con los campos personalizados
|
|
18
17
|
throw new request_validation_error_1.RequestValidationError(msg, typeMsg, userMsg);
|
|
19
18
|
}
|