fix(validation)
This commit is contained in:
@@ -168,6 +168,11 @@ app.post('/depesche', async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log("[INFO] Received print request");
|
console.log("[INFO] Received print request");
|
||||||
|
|
||||||
|
if (req.body.foreign_id == "") {
|
||||||
|
req.body.foreign_id = "undefined"
|
||||||
|
}
|
||||||
|
|
||||||
let value = {}
|
let value = {}
|
||||||
try {
|
try {
|
||||||
value = await schema.validateAsync(req.body, { allowUnknown: true });
|
value = await schema.validateAsync(req.body, { allowUnknown: true });
|
||||||
@@ -181,6 +186,7 @@ app.post('/depesche', async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await main(value).catch(
|
await main(value).catch(
|
||||||
(err) => {
|
(err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user