diff --git a/src/index.js b/src/index.js index 3e4248b..c5f9b2c 100644 --- a/src/index.js +++ b/src/index.js @@ -168,6 +168,11 @@ app.post('/depesche', async (req, res) => { } console.log("[INFO] Received print request"); + + if (req.body.foreign_id == "") { + req.body.foreign_id = "undefined" + } + let value = {} try { value = await schema.validateAsync(req.body, { allowUnknown: true }); @@ -181,6 +186,7 @@ app.post('/depesche', async (req, res) => { } + await main(value).catch( (err) => { console.log(err);