Added the field name to the error

This commit is contained in:
Mathias committed 2023-01-15 03:33:47 +01:00
1 parent 884e0be9aa
commit 18d3f8b0ba
1 file changed
+1 -1
+1 -1
View File
@@ -14,5 +14,5 @@ export const validateSchema = (res: Response, schema: ObjectSchema, object: Reco
const errorCode: number = codeMappings[error?.details[0].type || "any"] || 0; const errorCode: number = codeMappings[error?.details[0].type || "any"] || 0;
const message: string = error?.details[0].message || "No message provided"; const message: string = error?.details[0].message || "No message provided";
sendError(res, 400, errorCode, message); sendError(res, 400, errorCode, message, error?.details[0].context?.key);
}; };